tajiknomi
Posts: 11
Joined: Thu Jan 01, 2015 2:52 pm

Cross Platform GUI

Sun Jan 18, 2015 3:26 pm

I need to Build a GUI ,So that i'm able to run it on my Laptop & Android phone.

I have Built a python program & and made a GUI in Tkinter, But i'm unable to get the GUI interface on my Android !!
Whenever i try to Run it on Android, Its throw error, "No display etc etc".

1) How to run tkinter interface on android ?

2) Or any other Solution so that my GUI run on Almost every platform, I had Write Program in python.

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Cross Platform GUI

Sun Jan 18, 2015 3:33 pm

Instead of a traditional GUI did you think
about using a client-server model or creating a web-interface.

To answer your question : Install a VNC server on your Pi and
then a VNC client on your Android. Then you will be able to use
the TkInter interface on your Droid.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

scotty101
Posts: 3958
Joined: Fri Jun 08, 2012 6:03 pm

Re: Cross Platform GUI

Mon Jan 19, 2015 1:08 pm

You might want to try Kivy.

It is a GUI framework written in python that support both the RPi and Android device (along with others)
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

gkreidl
Posts: 6307
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Cross Platform GUI

Mon Jan 19, 2015 1:45 pm

scotty101 wrote:You might want to try Kivy.

It is a GUI framework written in python that support both the RPi and Android device (along with others)
On the RPi it is a large collection of bugs.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

scotty101
Posts: 3958
Joined: Fri Jun 08, 2012 6:03 pm

Re: Cross Platform GUI

Mon Jan 19, 2015 3:02 pm

Have you reported the bugs to the developers?
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

gkreidl
Posts: 6307
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Cross Platform GUI

Mon Jan 19, 2015 3:15 pm

scotty101 wrote:Have you reported the bugs to the developers?
No, after running some tests I simply dismissed it as not usable (on the Pi, on Android it was working much better),
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

Heater
Posts: 15818
Joined: Tue Jul 17, 2012 3:02 pm

Re: Cross Platform GUI

Mon Jan 19, 2015 5:30 pm

tajiknomi
Or any other Solution so that my GUI run on Almost every platform...
The human race has been building computers for "the people" for three decades now and this is still an unsolved problem. It's kind of shameful really.

The closest we have is GUI's built for the web browser with HTML/CSS/JavaScript. You can get those to show up on any machine with a modern browser, Windows, Mac, Linux, iOS, Android...

My next bet would be C++ using the Qt libraries. Qt code can be built to run on Linux, Windows, Mac, Android and others. Not sure about iOS.

What actually are you trying to do?

If its actually an application running on a Pi for which you want a GUI interface on another machine, phone, tab, PC etc, then the VNC solution may be a way to go. Or go the modern way and make your app a web server and have it serve up the GUI to browsers anywhere else.
Memory in C++ is a leaky abstraction .

User avatar
DougieLawson
Posts: 38837
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Cross Platform GUI

Mon Jan 19, 2015 7:16 pm

Heater wrote:The closest we have is GUI's built for the web browser with HTML/CSS/JavaScript. You can get those to show up on any machine with a modern browser, Windows, Mac, Linux, iOS, Android...
Are you deliberately ignoring everyone's favourite write once, debug everywhere language with it's AWT (old fashioned and deprecated) and Swing GUIs?
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

tajiknomi
Posts: 11
Joined: Thu Jan 01, 2015 2:52 pm

Re: Cross Platform GUI

Tue Jan 20, 2015 5:41 am

Thanks for the Feedback,

1) Web based Application would be Much better ,i think.I had Worked in C/C++ and Python, But i haven't used HTML yet, If u could send me the Reference from where i can begin this, I want to attach the Python Code with HTML GUI.Secondly, It would be much better if i could just make the GUI using IDE by just "Drag & Drop" instead of Coding, I like Saving time ;)

2) "Qt libraries,Qt code" , Will think about it, But is their any difference in traditional C and the C used for PI ? If their is, From where i should take start to Program my PI in C/C++.I have used C/C++ on my PC and on PIC MicroController, The Syntax for both have little changes, their must be some syntax changed for working in PI, Their for i need a Guidance to know the syntax for PI.

3) What would be the benefit to Program PI in C Instead of Python ? C would be fast compared to python Coz it is Compiled and Python is Interpreted Everytime. But is their any other benefit, Like less memory,Control etc etc ... ?

Excuse my English

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Cross Platform GUI

Tue Jan 20, 2015 7:22 am

1) http://www.webtoolkit.eu/wt and http://www.koanlogic.com/klone
might be interesting. I'm sorry , but i doubt you will find a
drag'n'drop IDE for this.

2) C and C++ AFAIK were developed on "big" unoxoid systems.
Microcontrollers propably only support a subset of those
languages and you're propably just being confronted with
the actual breadth of the C Standard library and C++ STL
which becomes obvious on Systems like Linux. I guess you
will just have to try a "C/C++ Linux" tutorial for beginners since
you will find very little for people re-learning
from a MCU background.

3) Yes, in C you become responsible for memory allocation and
deallocation too. Depending on your experience this may allow
to save memory , i guess . A lot of Linux features are also only
directly available to C programmers too , but especially
Python does a good job wrapping around it.


ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

Heater
Posts: 15818
Joined: Tue Jul 17, 2012 3:02 pm

Re: Cross Platform GUI

Tue Jan 20, 2015 9:44 am

DougieLawson
Are you deliberately ignoring everyone's favourite write once, debug everywhere language with it's AWT (old fashioned and deprecated) and Swing GUIs?
No. Java is not even in the running when it comes to cross platform GUI's. Can an app using AWT or Swing work on Android, iOS, ChromeOS?
Memory in C++ is a leaky abstraction .

Heater
Posts: 15818
Joined: Tue Jul 17, 2012 3:02 pm

Re: Cross Platform GUI

Tue Jan 20, 2015 10:05 am

@ghans,
C and C++ AFAIK were developed on "big" unoxoid systems. Microcontrollers propably only support a subset of those languages
C was developed on old mini-computers like the PDP/11 with probably only 32K or so of RAM, less than most micro controllers today, and disk storage millions of times smaller than we have on an SD card.

C++ was developed in an era when processors speeds, memories and storage were thousands of times less than we have with the Pi.

The C and C++ languages are the same on on modern micro-controllers as on supercomputers, after all most of them are using the same GCC compiler. Certainly down to the AVR chips (Arduino is programmed in C++ with GCC).

There might be some oddities for things like the small PIC but the we are really pushing the point.

Certainly you will not find all the standard library support on micro-controllers. Especially the C++ stdlib is just to big for the space available. But language wise things are the same.


@tajiknomi

What actually is the purpose/function of your application?

I think we need to know that before advising on possible solutions.
Memory in C++ is a leaky abstraction .

ktb
Posts: 1447
Joined: Fri Dec 26, 2014 7:53 pm

Re: Cross Platform GUI

Tue Jan 20, 2015 11:52 pm

I've used Phonegap/Cordova to deliver HTML5 apps on iOS and Android. It took a lot of tinkering for them to perform decently on low and mid-level devices. Those worked fairly well in emulators on PC web browsers (Ripple Emulator).

I've had my eye on this project https://github.com/breach/thrust - https://github.com/breach/thrust/issues/254

Sorry that I don't have any better suggestions. There have been some pretty good ideas presented here already.

https://github.com/nwjs/nw.js/issues/193

User avatar
iinnovations
Posts: 621
Joined: Thu Jun 06, 2013 5:17 pm

Re: Cross Platform GUI

Wed Jan 21, 2015 3:19 am

There are just so many "things" and applications that drag and drop is just not there for delivering a custom app with the performance that you want, especially from a modestly-powered SBC like the Pi. You need to acknowledge the limitations and build your apps very efficiently to optimize the resources you have available. It's really a great way to force yourself to not be lazy and write clean, well thought-out code.

C
CuPID Controls :: Open Source browser-based sensor and device control
interfaceinnovations.org/cupidcontrols.html
cupidcontrols.com

tajiknomi
Posts: 11
Joined: Thu Jan 01, 2015 2:52 pm

Re: Cross Platform GUI

Wed Jan 21, 2015 4:24 pm

@ Heater : I want to make a Home Automation System.

1) I want to make a Software which will provide me a decent Interface on both Laptop & Android Phone.

2) Web based is quite a Good idea Coz all i need is just a browser then, But i'm not Familiar with Web applications.

3) I have Worked on traditional C/C++ Programming for almost 2.5 years.

4) Someone suggest me that use "QT library and QT Creator" to build an application.

5) I just want an easy & efficient way to build my application.Now i'm Confuse, should i start to learn HTML or QT, I'm stuck here.

Thanks for the feedback guys, I appreciate your suggestions....

otani
Posts: 67
Joined: Fri Dec 13, 2013 4:18 am

Re: Cross Platform GUI

Wed Jan 21, 2015 6:47 pm

I would like to recommend Lazarus and free pascal.
http://www.lazarus.freepascal.org/

The biggest feature is many quantity of the components are provided,
http://wiki.lazarus.freepascal.org/Comp ... xamples/ja
It is very simple RAD system, similar usage of Borland delphi , but Free !

OS: Windows,WinCE, MAC OSX, Linux(incl:ARM), iOS, Android

Android interface
http://wiki.lazarus.freepascal.org/Andr ... ndroid_GUI
iOS interface
http://wiki.lazarus.freepascal.org/iPho ... evelopment

Of cource , cross compiler are available , however you can easily compile on 512kB RAM of Raspberry pi.
Qt5 is too heavy for RPi , If your host PC is powerful enough forget about this..
I have a question. Is your target Android, not RPi? What is the relation with RPi?

Heater
Posts: 15818
Joined: Tue Jul 17, 2012 3:02 pm

Re: Cross Platform GUI

Wed Jan 21, 2015 8:33 pm

tajiknomi,
I want to make a Home Automation System....I want to make a Software which will provide me a decent Interface on both Laptop & Android Phone.
OK. Lets take that as a specification.

In your home you have: Lights, heaters, alarm systems, doors, freezers, air conditioners, sound/video systems and so on that all need to be connected to the automation system.

Then you need some means to monitor and control that mess of stuff. Perhaps whilst not even at home. From the other side of the world. And, as you say, from whatever machine you happen to be in front of at the time: Windows, Mac, iPhone, Android whatever.

What to do?

1) Have all those devices in your home communicate with some central computer. That central server will be able to collect information from the devices and send commands back to them.

2) Have that central computer accessible to the internet. Either arrange that your home connection is accessible or use a server in a cloud service like Google Cloud or MS Azure or whatever.

3) Have that central control server run a web server. Via the web pages served up by that web server you will be able to connect using a web browser on any machine that has one and monitor/control you home.

What you need to know to make this work:

For the central server part: JavaScript, node.js, HTML, HTTP.

For the devices to server part: MQTT, I don't know depends on how you want to connect them.

For the web page UI stuff: HTML, CSS, JavaScript, react.js, bootstrap.

Does this all sound very complicated?

Well, yes it is. A simple choice of a Free Pascal/Lazarus GUI vs a C++/Qt GUI vs a HTML/CSS/JavaScript GUI is only the end of the line.

But as you see, the HTML/CSS/JavaScript GUI solution is the only one that works everywhere. And does not require rebuilding and customizing code for every platform it runs on.

And whilst we are here, the idea that Qt is to heavy for the Pi is certainly not true. I have Qt apps that run on the Pi just fine, including accelerated 3D graphics using GLES.
Memory in C++ is a leaky abstraction .

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Cross Platform GUI

Wed Jan 21, 2015 8:57 pm

The wt toolkit should enable you to make "portable" web applications in C++ without learning HTML or JS at all .

If you want to get even more confused , have a look at the GTK+ 3 "Broadway" backend.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

Heater
Posts: 15818
Joined: Tue Jul 17, 2012 3:02 pm

Re: Cross Platform GUI

Wed Jan 21, 2015 9:20 pm

ghans,

Thanks for the heads up on wt. Never heard of it before.

It's not clear to me that having to learn this : http://www.webtoolkit.eu/widgets/layout/dialogs for a simple dialog pop up is any easier than the HTML/CSS/JavaScript alternative.
Memory in C++ is a leaky abstraction .

dddomodossola
Posts: 42
Joined: Thu Jan 22, 2015 8:56 am

Re: Cross Platform GUI

Thu Jan 22, 2015 9:02 am

Hi tajiknomi,

I had your same problem in the past, so I developed a new gui library to solve the problem.
It is multiplatform (pure python library) and it can be accessed remotly (you can run your program on the raspy or on an android device, and see the UI on your personal computer).
Here is the link: https://github.com/dddomodossola/gui

I hope it can help you. ;)

otani
Posts: 67
Joined: Fri Dec 13, 2013 4:18 am

Re: Cross Platform GUI

Fri Jan 23, 2015 5:23 pm

Heater,

> the idea that Qt is to heavy for the Pi is certainly not true.
> I have Qt apps that run on the Pi just fine, including accelerated 3D graphics using GLES.

I agree that apps is not heavy.
However, I feel that "Native Build of Qt5 on RPi takes 38 hours to compile", this is heavy compared than others.
http://qt-project.org/wiki/Native_Build ... spberry_Pi

FPC/Lazarus takes about 40 minutes for re-build itself from source code.
Application compile takes about 1minutes on RPi native/self compile.
It also can handle GLES, further more GUI form can be designed using RAD tools.

BTW, I am looking for the RAD tools of c/c++/c# which works on arm-linux.
such like Microsoft:C# or Borland:C++Builder,but works on Raspi. Anyone knows about it ?

Code::Blocks + wxSmith might be candidate.
http://www.codeblocks.org/
wxSmith features comparison
http://wiki.codeblocks.org/index.php?ti ... h_features

Heater
Posts: 15818
Joined: Tue Jul 17, 2012 3:02 pm

Re: Cross Platform GUI

Fri Jan 23, 2015 5:45 pm

otani,

I do agree that a build of Qt on the Pi takes a long time. I have done it myself with my results posted here: http://the.linuxd.org/qt-5-2-for-raspberry-pi/
And I know that fpc is a fast compiler. We use it all the time for embedded projects at work.

However:

a) So what? Building the linux kernel or your whole OS will take ages. It's not like you have to do it everyday. Qt5 should be a simple package install. Which it will be when we move to a Debian Jessie based system.

b) Whats wrong with qtcreator as an IDE? It has drag and drop GUI building as expected.

c) Programming in C++/Qt is much nicer. OK that's just a personal preference.
Memory in C++ is a leaky abstraction .

timrowledge
Posts: 1345
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
Contact: Website

Re: Cross Platform GUI

Fri Jan 23, 2015 6:29 pm

Try Smalltalk. It's the original RAD system. The original fully object oriented system. It's really rather portable (though perhaps oddly and maybe importantly to you, not currently working on Android because nobody seems to care enough to maintain it there) and amongst other things it runs quite nicely on a Pi, has a jolly good web server system (http://www.seaside.st/) and actually helps you think about problems.
Take a look at www.squeak.org, http://wiki.squeak.org/squeak, https://www.youtube.com/watch?v=Es7Ryll ... freload=10 and see what you think.

It's been available on ARM systems since 1987. There's some decent history of making it work.
Making Smalltalk on ARM since 1986; making your Scratch better since 2012

cleverca22
Posts: 528
Joined: Sat Aug 18, 2012 2:33 pm

Re: Cross Platform GUI

Fri Jan 23, 2015 7:16 pm

Heater wrote:DougieLawson
Are you deliberately ignoring everyone's favourite write once, debug everywhere language with it's AWT (old fashioned and deprecated) and Swing GUIs?
No. Java is not even in the running when it comes to cross platform GUI's. Can an app using AWT or Swing work on Android, iOS, ChromeOS?
you can do the core logic in java, and use that on every platform (even ios)

but the gui layer would have to be redone for several, swing/awt for the desktops
android for android
and for ios, you can use j2objc to transpile the java into objective c, then write the gui with ios tools

but yeah, youll have to write 3 seperate GUI's

Heater
Posts: 15818
Joined: Tue Jul 17, 2012 3:02 pm

Re: Cross Platform GUI

Fri Jan 23, 2015 8:10 pm

timrowledge,

I'm sure SmallTalk is a wonderful thing. It has a a lot of historical creds but I have never looked into it.

Seaside seems to be a disaster though. One is not running Smalltalk in the browser unless it's been compiled from Smaltalk to JS.

The first Seaside example app I find is a simple counter incrementer. It takes a round trip from browser to server and back again to update a simple counter. Terribly, visibly, slow.

cleverca22,
you can do the core logic in java,...
In the modern world the interesting "core" logic happens on the server. Use whatever language you like. There are better choices than Java.

The GUI layer, on Android, iOS, Windows, Mac, Linux, etc has to be created or recreated some how.

One can avoid writing many separate GUIs by just writing one. In HTML/CSS/JavaScript. Every device has a web browser, job done.
Memory in C++ is a leaky abstraction .

Return to “General discussion”