Using PyQt5 to interact with HTML content in Android app - android

As the title says, I need a way to use PyQt5 to interact with HTML/JS web elements from within an app that should be deployed (also) to Android. I started looking at QWebEngine and QWebChannel and the result in terms of interaction is exactly what I need. Sadly, I realized that QWebEngine is not supported by Qt for Android, and I am kind of stuck right now.
I've been reading that is somehow possible to use the deprecated QWebKit instead of QWebEngine, but:
One would need to compile PyQt with QWebKit (and I don't know how to do that)
I have no idea how to replace the functionality of QWebChannel (is this required or should I be able to use it along with QWebKit?)
I don't know if it worths the effort, given that QWebEngine is newer and possibly it will be supported in the (hopefully near?) future.
Last, I should add I don't know anything about QML and its interactions through PyQt, if this is important in this scenario.
Can anybody suggest if using QWebKit now is the way to go, or an alternative path to follow? Should I consider giving up using PyQt for my purpose at present?
-- EDIT1 --
I think I found something interesting regarding using QtWebView.
Qt WebView provides a way to display web content in a QML application
without necessarily including a full web browser stack by using native
APIs where it makes sense.
This is useful on mobile platforms such as Android, iOS, and WinRT;
especially on iOS, where policy dictates that all web content is
displayed using the operating system's web view.
Unfortunately, this imples understanding a bit of QML and using QQuickWidget to embed the QML webview inside a widget (as suggested here).
Does anybody have experience in using QtWebView with PyQt5 and can provide some suggestions? Would this be a reasonable path?

Related

C++ vs native implementation of iOS/android

I'm developing an app for iOS and android that identifies songs. We have a matching engine in c++ that works well, but my question is about the rest of the app. We have a user interface design that allows the user to record, match and save, as well as share, edit, and see their recordings.
I'm not a coder - just a designer- and I'm getting conflicting advice about how to implement. One person wants to do the majority of the interface in c++ with just a thin native GUI skin, while the other says we should write in native IOS (swift) and Android and only have the engine in c++. The argument for c++ is it will be a single code base to maintain - it would include doing the sharing, storing history, displaying sonograms, etc. The argument against is that in fact it will not be easier to maintain, and will also create a lot of problems making calls, for example, between the interface and the sharing module.
Hope this is clear - it's a very hard thing for me to assess as ignorant as I am! Any advice would be greatly appreciated.
In my opinion, the way to go is to write the GUI the way it was meant to be. Native iOS/Android will yield a much better user experience and will allow you to use the platform latest and greatest way of implementing a UI.
Also, I am assuming that the engine will probably not be developped by the same people that develop the GUI itself, so the argument that it would be simpler to have a single code base doesn't really make sense.
Another solution could be to use Xamarin, so that you can consolidate iOS and Android development, while still having a common C++ engine.
Edit: Typo

Asp.NET Apple Android Windows8 phone GUI

I am thinking of developing a program within ASP.NET. But that I could port easily to Apple, Android and Windows phones and tablets. I also want the program to be able to run on PCs (MAC´s?).
This seems to be fine. However, the normal GUI of Windows does not look at all like the GUI from e.g. iOS or Android. And this would be a big show stopper. It should be at least optimized for touch mode. So all on screen widgets should be a bit bigger.
Are there libraries, providing controls, which looks like normal ones on the operating system? It would be best if this works kind of automatically. So the program should find out where it runs and load the standard GUI best fitting to the device, where it is being started.
I could of course develop own controls, but this may be a bit too much of effort.
It would also be very nice if the library would handle different screens or modes like portrait and landscape. So that it may switch depending on the orientation of the tablet, or phone for instance.
I am searching for something like that, which provides a good result, without the programmer needing too much to do by himself.
I also like if one can recommend a library he is using already by a bigger program. From my own experience, you get to know the strengh and weakness of such libraries with the time passing by.
Best Regards.
I already discovered some tools like PhoneGap, Sencha, Mono. I do not know, if these are well suited for me.
I like to create an app most likely for all plattforms at the same time. Is this the case with e.g. PhoneGap?
I am not familar with JavaScript, or CSS or HTML development.
I am an experienced C# programmer and I am quite familar with Java. So VisualStudio is my daily working environment, and I am using Eclipse also a lot.
Mono:
I only read about it and found out this aspects:
cost 999$ to use it in Visual Studio. Hope that this price includes development for all plattforms and not just one. Did not yet check this.
The coding looks very good.
There are APIs for Android, iOS, and Windows Phone to setup controls. So these parts needs to be rewritten for any supported application. One may create a core library, which can be used for all components. This aspect is not so nice.
However, I would prefer a solution, where the GUI is even described on another level. And then it should be brought to the current plattform automatically, if not specific libraries are used. So HTML5 may be more flexible.
Best Regards,
Patrick

Android Cross-Platforming

I want to know more about Cross-Platform. I'm currently working on my thesis and decided to make an Android Application but not all target users uses Android device. So, We've come up with an idea to Cross-Platform the android application.
I have read the same topic but it didn't get to me too well. iOS / Android cross platform development. I want to know if there is another way than using the frameworks discussed in the link.
I want know what is the best/shortest way to cross platform a Android Application?
Cross Platform tools are in my opinion not a good idea at all. Android is Java, and iOS is Objective C. Android can use NDK to use a C/C++ library so theoretically if you did most of your code in C/C+ it could be used on both sides. I think two natives is more in order. Study NDK to see what could run on both devices. Lets say you built your app as a C++ Library except for UI interactions. Then in theory the library should work on both sides. C/C++ a lot easier on iOS than android however.
Also it really depends on the dependencies your app will have. Lets say you want to use a library but its only available in Java or C++ how does this effect your decision.
You might also consider designing your app so that it just captures data on the devices and the actual processing of the data takes place in a web service.
Another way is use Mobile Web HTML5 Framework like Phonegapp, Sencha touch and more.
Although web technologies don’t perform as well as native, but it is a useful thing that you can try.
See Choosing Mobile Web HTML5 Framework and http://operationproject.com/2011/adventures-in-html5-part-one/
Android application are apk files that are basically zip file that contains dex/odex files and all other resources that you may wish to add.But I think you can use any coding language to develop as long as you have IDE that converts your code to apk and dex .And most important of all your programming language must support corresponding api or must have something similar to cross compile.The reason Google used Java for Android was they felt it is convenient to do it(read it during case Google v/s Oracle)
Personally I feel cross-platform is good since it increases the developers base and understanding of the System (here Android).And I think the same analogy would go with other Systems as well.

Cross Mobile Options

I created an Android app. While creating one specific app was an interesting challenge, I'm now looking into creating a group of similar apps.
I'd like to create a group of similar Android apps and then move on to creating the same on tablets and iOS... (anything mobile).
I've considered doing so with a product called PhoneGap or doing a web based mobile app. Both of these options seem less than ideal. Doing the Android app I've been frustrated by Java's lack of control and low level constructs. Moving to something like a web based app seems like the exact wrong direction.
C++ is my language of choice. It has the ability to work at a low level, is highly portable across platforms, and has significant support for generic coding which would be useful for generating a group of similar apps. However, the Android documentation suggests to not use C++ unless your goal is porting existing code or dealing with computationally heavy tasks.
I'm leaning towards using C++ anyway, but are there other options I've not considered?
Thanks
You could in theory write your logic in C++ and then have UI layers on top that make use of it. If you are really comfortable with C++ that might be the way to go.
Almost any other parts (networking, UI, animation, etc) are better off being done in the native language of the platform. Use of cross platform solutions always limits you in some way, and usually leads to an application that is not as good as it could be for any platform.
Well, Google's recommendation to not use C++ is based on the following, I believe. C++ is low level, so you can get extra performance out of it if you know what you are doing. Google makes the reasonable assumption that many programmers do not. It is easier for an inexperienced programmer to do harm in C++ then to get a performance boost.
But, if you know what you are doing, it can help you. UI elements on both iOS and Android are implemented in their main language (obj-c, and Java respectively) so there is not a great way around that, but you can write core logic and other functions in C++ and it will be portable between them (iOS can use C++ directly and Android can use it via the Native Development Kit).
There are a few other options available. The one I ended up using is Appcelerator Titanium but please stay away from it. If your project gets complicated or large at all you will hate yourself for choosing it, as I did. Another interesting one that uses C++ instead of Javascript is Marmalade. I haven't used it though, so I can't comment on it.
A non-free solution that I hear good things about is Xamarin, who have ported both environments to C# and a .NET using Mono. However, you still have to write two versions of your code for the UI as far as I can tell.

How do I convert an iGoogle gadget into an Android widget?

I'm trying to recreate this progress bar clock gadget I built in iGoogle as a widget for Android devices.
It seems like it should be pretty straightforward, especially considering the code is only 75 lines, but I have very little experience with developing in Android - even more-so when considering that I would like it to be a widget.
Hopefully Google will develop (if they somehow aren't already) a translation tool to accomplish this task, but until this, I'm out of ideas.
So here are some questions:
Are there any conversion tools for this yet? Something that would allow you use a program and/or a web service to point to the XML file used for the iGoogle gadget and have the program/service return back the necessary project files needed fro Android apps?
I'm not sure if this approach mentioned above is at all possible, but I'm sure that an Android app can be developed to perform the same way as it does on iGoogle - it's pretty basic Javascript + CSS syntax.
In any case, where should I start and what tutorials (if any) exist with regards to this specific request of translating iGoogle gadgets into Android apps (preferably avoiding the "iframe" type of app framework that just points to the mobile version of a webpage).
Are my assumptions $| intentions out of scope here? I feel like this is an easily doable project via the traditional means of using Androids SDK with Eclipse, for example. I tried messing around with the online GUI that Google had for developing Android apps, but the programming interface was like Visual Basic for 3rd graders - it just wasn't too intuitive either.
Also, any other suggestions on what steps I could take to execute this task would be greatly appreciated. I'm just guessing on how this could be done potentially, but if anyone has done something like this already or has insight towards this conversion process that's more valuable than pure speculation as I was doing above, please answer back with some suggestions as to how to accomplish this iGoogle Gadget -> Android Application conversion process.
I found another somewhat similar question on SO, but it doesn't have the same end result that I'm looking for: iGoogle Gadget on Android Phone as APP or Widget
Thanks a bunch for any help!
So far there is no conversion tool that allows converting to an Android wiget a preexisting widget written for another system. You have to rewrite it.
I know some code generators exist, but I don't know them. They won't take the gadget you are referring to as a source, but maybe they can help you to redesign it for Android. This requires checking.

Categories

Resources