how to embed an SVG enabled webkit webview in an Android app? - android

Is there a way to embed a customized webkit engine in an app to add a WebView with SVG support ?

The according Bug Entry mentions some android core dependencies which seem not-so-easy to replace, not sure if all of that could be included in a built to provide exactly a webkit webview with your app.
However, in general one can use another library project to be referenced and included on compilation. And then there is a way to include other JAR files, a way to convert an existing project into a library as well as even a way to butcher an .apk and get the code out (which again you can turn into a libary).
Never done it, but in theory, get a library, .jar or .apk of the browser you want to bundle (as mentioned the beginning seems not the best candidate), look into the original code what is done to instantiate that browsers view in an activity - and off you go.
Would love to hear when you or anybody else has accomplished to do such a thing, i couldn't wait to see if we could bundle it with multitouch enabled (another big drawback in 2.x) for multitouch on the android stock browser on 2.x devices i started a polyfill project out of desparation (which works surprisingly well, but is also way simpler than emulating a complete SVG interpreter), so for matter of SVG and providing the best browser runtime for the job, this would be great.
P.S. There is one completely different workaround depending on what you want to do with SVG. If it's just some small stuff to fill on the screen at times you might check google for "svg polyfill" which leads to a myriad of solutions - i couldn't recommend one straightaway, as those implementations are so different that you should evaluate them with your actual app.

Related

Using PyQt5 to interact with HTML content in Android app

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?

Android UI framework

I have some issues in working with Android layouts and make them adapt for all screen sizes..
I have found that there is an alternative solution : Android Bootstrap http://www.androidbootstrap.com/ for that and provide nice UI components (buttons etc...).
Since I'm developing natively, is this kind of frameworks won't make the App runs slower ?
Is this only a UI framework like for the web (Bootstrap from twitter) ? if not, can we use with it everything in Android (Camera, micro etc...) and Can we include some Jars like Zbar ?
Thank you.
I have found that there is an alternative solution : Android Bootstrap
It is not an "alternative solution". You still will need to be "working with Android layouts and make them adapt for all screen sizes", because Android Bootstrap does not change much related to that.
and provide nice UI components (buttons etc...)
It uses the same Android widget set that all other Android apps use.
is this kind of frameworks won't make the App runs slower ?
There is nothing in an Android Bootstrap project that would necessarily make the app significantly slower.
Is this only a UI framework like for the web (Bootstrap from twitter) ?
It is not even that. It is a starter project that demonstrates how to tie together a dozen or so open source libraries for Android app development. You can think of it as an extended version of the templates used to create new applications and activities in Eclipse or Android Studio.
This is not to say that Android Bootstrap is bad -- far from it. However, it does not resemble your description.
can we use with it everything in Android (Camera, micro etc...)
I have no idea what "micro" is with respect to Android. Since you are writing an Android application, just like any other Android application, you can use it with whatever parts of Android you choose to.
Can we include some Jars like Zbar ?
I see no reason why not.
It is very common for such templating engines not to have exactly most components you need. for android it is basicallly about adding support third party libraries to get the exact experience you need.
Thus you may want to consider adding more or lacking parts by leveraging some external libraries like those from HERE

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.

How to display AdMob ads in FlashBuilder 4.5.1 mobile project?

I am currently developing an application in the latest version of FlashBuilder and I cant seem to find out how I can incorporate AdMob ads or any other Ads into my application. Does anyone know how this can be done? There seen to be a few tutorials online focused on Flash however im not sure how to get those to work in the Flex environment. Thanks
Anything that works in AS3 will work in Flex (since Flex is built up on top of AS3) it's just going to be a matter of making sure you've included the appropriate swc dependencies in your project (or AS3 code if you're just copying it in). The only other thing to be aware of is that the Flex 3 framework requires that elements added to components are a UIComponent or sub-class thereof, since this object isn't present in the Flash player itself (it's part of the Flex framework code) you sometimes need to add the Sprite or MovieClip or whatever to a UIComponent then add that to your "page" or component. Please drop a URL to the code you're trying to integrate with and I'll edit this answer to include specifics.
Also to note I specified Flex 3 because in Flex 4 the requirement is that the component implements IVisualElement (and is added via addElement vs addChild).
Well, There are always the Adobe Docs that are a good reference (under "Displaying Ads"). They suggest using the StageWebView object viewport. But, Jespers tells you how to do the same thing, and mentions Rohde's wrapper class that makes the whole thing easier. Choose your favourite.

Why does Android page alignment cause issues with linking? (Android running native code)

I was wondering if someone could provide me with a bit of theory. I read that;
Page alignment causes changes in
linking. Of very high impact on the
success of compiling software for
Android is the fact that Google forces
compatible binaries to not be page
aligned for the text and data section.
This requires changes in the way of
linking object files. For self-written
software, one can take precautions and
react on this fact with compiling all
shared libraries accordingly. For
already existing source code, changing
the linker’s behavior can present a
very tiring and, often, an even
impossible task.
But personally know very little of page alignment, what does this actually mean? Is this the reason we must change the asx file when compiling native libraries for use on Android? Here's the context for that statement.
Apologies if you think I should just Google this, I did try but I'm just looking for a bit more of an explanation than there is at that link.
Kind regards,
Gavin
using CodeSourcery and a linker script is not a valid way to create a native library on Android anymore.
Take a look at the native library example at development/samples/PlatformLibrary/ to see how you should build a native library.
For the start, you can modify the PlatformLibrary example to make your own library. Compiling the code should create the following files:
out/target/product/generic/system/app/PlatformLibraryClient.apk
out/target/product/generic/system/etc/permissions/com.example.android.platform_library.xml
out/target/product/generic/system/framework/com.example.android.platform_library.jar
out/target/product/generic/system/lib/libplatform_library_jni.so
You do not have to worry about those linker issues anymore.
Regards,
Manny

Categories

Resources