Is Android + PhoneGap/Cordova always a headache? - android

I've been developing a mobile app for both iOS and Android. Due to time/budget constraints, we initially selected PhoneGap/Cordova as mobile app framework so we could write once and deploy to both platforms.
This plan has worked fine for iOS, but we're finding that Android's browser/engine is kind-of a piece of garbage (to put it nicely). Every time we add a new feature, we find one more thing that the Android browser doesn't support, or only partially supports, or fully supports but will randomly fail from time to time, etc. Even once we code around the Android issues and get things working smoothly, test it on multiple devices/versions, and deploy a new app to the Android market, we immediately start getting emails and reports from customers who can't get the app to work on their device. We have them uninstall/reinstall, reboot their phone to clear the memory, etc., and their device still consistently fails (and by "fail", I mean it typically just freezes and/or won't respond to touch input - it usually doesn't crash, or anything). The app works fine for most people, but there are still quite a few devices that inexplicably fail.
I don't mean for this to be a rant, I'm trying to analyze whether the Android+PhoneGap path is the correct path for us. Specifically, I'd like to find out the following:
Are there people out there having success with an Android+PhoneGap app? or is Android+PhoneGap always going to be a problem on certain devices?
Am I likely to have more luck with a native Android app (I've never attempted one)? Or are multiple devices/versions always a problem on Android, even with a Native app?

1) Yes. There are are good apps which are based on Phonegap and works well in all devices.
2) It depends on what features of the Android you are going to use. Few versions that does not support some features that's available only to new version.
BTW, what is the minimum required version that you have selected for your app? I assume you are developing the app with Android as base version.
When creating a new Android project, you have to set the minimum required platform version. If you set something higher and use the app in a lower version which does not support the feature, results are going to be different.

After having worked with Android+Cordova for some time now, I have the following suggestions/comments for anyone thinking of going that direction.
Consider using Sencha Touch, or jQuery Mobile, or another mobile framework that has already coded around the Android-browser issues (which there are a LOT of). Consider not straying too far from the default styling that come with those frameworks. Simply styling a normal web page to look like a mobile app is a constant headache to get working on multiple versions of the stock Android browser.
Although the stock Android browser is garbage, Mobile Chrome is pretty nice. In Android 4.4, the Chrome engine becomes the default engine used by a webview of an Android app. If you don't like Sencha or jQuery Mobile or the like, you could hold off and just use a mobile web site for a while until Android 4.3 and below become insignificant. It's not hard to get things working on Mobile Chrome.
Even without Sencha/JQM, you can still muscle your way around the stock browser issues, but it's almost as frustrating as developing for IE6. Okay, maybe not that bad… but close.
I've started experimenting some with a native Android app, and, so far, it seems like less of a headache than building an app with Android+Cordova+lackOfSenchaOrJQMorTheLike. The things I've experimented with work pretty consistently among different Android versions. But I don't have much experience there, so I can't comment too much on a native Android app.

Related

How to use the current Chrome Engine for Cordova Apps?

I have a very big problem and unfortunately I cannot find a solution. Help from some professionals would be really great. Thanks!
The little problem
I have a Angular Web App / Android App using Cordova. My app needs at least the Chrome Engine 50 to support all functions and looks right. Unfortunately I noticed that there are many devices that use a much older version. Also the devices do not use a common source for the Chrome Engine. Some use the Chrome Browser itself or the Android System WebView. In these two cases I can tell my testers, install the two things and then it works. Currently I check at the start of the app which version is installed and if it is less than 50 I show an info that users have to update ther apps / components particularly important here the two things (Chrome Browser itself or the Android System WebView). I rather say my users that they should update all ther apps because some hardware manufacturers have their own apps that include the Chrome Engine. That alone I find very unpleasant.
The biger problem
But it is worse with devices that have their own Chrome Engine built into the firmware. So one that you can not update at all via the apps update only just the hardware manufacturer of the phone can update them with firmware updates. So many cheap devices that don't get any more updates simply fall out and bring me possibly bad ratings.
What can you do?
Maybe someone has an idea? Because this way I can put my app in the store from Android 4.4 on but even 6.0 devices have older Chrome Engine versions in their firmwares. Can't I provide a chrome engine version or say I use it there from Chrome or from the Android system WebView? I'm really on the edge and need a clever solution.
I would be very happy about some help or exchange. Thanks a lot.
Best regards
Robi

how to run old IE browser in android?

I have to run a legacy web system in android, but new browsers are not compatible with this system, however IE is compatible with this system. so please let me know how to use old IE in android?
Maybe you can run IE in some windows emulator, like https://sourceforge.net/projects/limbopcemulator/
This is joke ... in the first place I don't think the emulator would be good enough to make this work. Even if it would, WinXP and old IE is security hole plus android+emulator doesn't sound like stable environment, so overall it would either not work, or be extremely vulnerable to any attack from basically any kid around.
Drop the legacy web system, it's over (like 5+ years over).

Debug App in Galaxy S5

I am building an Android app for my company, using Android Studio 1.5.1 . I've discovered that the app won't work on some Galaxy S5 phones.
These phones just show a white screen when the app runs.
This error happens on Galaxy S5 devices with Android version 5.1.1 But not on an Galaxy S5 Device running Android version 5.0
I'm focusing on the Android Version as a clue to solving this bug.
I can't actually get one of the devices so I've created several Virtual Devices. There are 6 Downloadable system images of Android 5.1.1 in Android Studio's Virtual Device Configuration wizard. I've installed all of them. none replicate this white screen error.
What else can I do to uncover this bug?
If it helps answer my question, my app relies heavily on server communication. The whole app is just one Webview with a few html & JS files.
The problem with emulators is that they are not reproducing actual device behaviour(especially, once many OEMs like Samsung tend to customise Android based on their needs), so I'm afraid the only options you have are:
Get Samsung Galaxy S5 with 5.1.1
Apart from obvious ideas "go to shop and buy", I can recommend you:
to take a look at Open Device Lab. It operates around the world and there's an arguably good chance to find the device you need there;
build a pool of alpha-beta users you can talk to and share new builds. Google Play has quite rich functionality in this area. Samsung S5 is quite common model, so it shouldn't be a problem to find people with it. If your product is "public", you can try to find beta-users on services like BetaBound or just among your social media network;
Use Analytics tools to collect more data from affected devices and act based on the information you get
There're dozens of different frameworks for accomplishing it. I can suggest Crittercism as a super powerful and comprehensive tool. In particular, I'd definitely log:
All handled exceptions
Add breadcrumbs (short string to capture app run-time information) to all Activity/Fragment lifecycle methods, to Application's methods (as white screen on start might mean some issues there), to all meaningful async tasks, etc.
If app gets into suspicion state - log it as a handled exception, so you can see the whole trail of breadcrumbs and track history of exceptions for the user. Unfortunately, you won't get trail of breadcrumbs, before something has been logged as an issue (crash or exception). There're frameworks, which log everything, like MixPanel, for example, but I honestly think that Crittercism suits much more here)
Crittercism will also catch & report all crashes happen in the app and
The Get Started Guide is here and it's pretty straightforward: http://docs.crittercism.com/android/android.html
Saying that, I'd suggest you to integrate some analytics anyway, as it'll help you in the future and to try to get affected phone in hands for test.
I guess the culprit is webview. Can you check the webview version on which the issue is reproducible.
To check the version you need to go to settings->Application Manager-> Downloaded Apps-> check "Android System Webview"version
We had a similar issue when the screen used to go blank and it used to happen only on particular version of webview. The issue was fixed by Google later.
The chromium webview layer is now updatable from Google Play.
For more details refer-http://developer.android.com/about/versions/lollipop.html#WebView
I assume you are building a hybrid app.
If the webview is the culprit, you could try crosswalk.
It adds Mb's to your app but it makes sure every device uses the same webview (latest chromium). Moreover rendering differences etc are also minimized.
if you are using cordova run: cordova plugin add cordova-plugin-crosswalk-webview and that's it.
If you implement this and the whitescreen problem is gone, you debugged it in a sherlock holmish deduction way...
The problem is not with emulator. It is with WebView in Android versions 5.1 onward.
Try
uninstalling the updates for "Android system webview" app (go to
settings and look for it under "downloaded") it works just fine!
Source - similar question

Android browser compatibility and fragmentation

We have an iOS html5-based app. One of the questions that's coming up a lot is if and when we are going to port to Android.
Because it's mostly html5, a port should be relatively easy. However, the HTML looks different on my Moto G than it does on iOS, even though Chrome on my mac does render it correctly. Now, I have some experience with cross-browser html development from back in the netscape/ie6 days, so I can probably figure out what's going on.
What worries me more though, is the fragmentation. If I get it to render correctly on my Android device, how do I know it works correctly devices with an older version of the OS too? On iOS, we simply require iOS6, as most iPhone users upgrade their OS. On Android, this is a lot more difficult, as users don't tend to update (or the manufacturers don't even provide updates).
Do I need to get my hands on a ton of different devices to test on? Any easier ways to test this? I'm new to Android development, so any advice would be greatly appreciated!
This is a common issue across Android Development. Device Fragmentation... our nemesis. What will make it even more difficult, as I have experienced, is that Android ditched the old WebView in favor of a Chromium based WebView in KitKat. So even the APIs are no longer the same from your Moto G to previous devices.
That said, there are a fair amount of resources available in helping assist with creating a Web App that will work with your site and the native device. Quite a few examples too.
I would begin here: https://developer.android.com/guide/webapps/index.html which includes a subsection devoted entirely to the Chromium changes incorporated in KitKat (https://developer.android.com/guide/webapps/migrating.html)
Additionally, there is this Pixel Perfect information site as well: https://developer.chrome.com/multidevice/webview/pixelperfect
Now you can set your minimum accepted and targeted API levels on Android, just as you would on iOS. For instance, if the minimum is 15 and it is targeted for 19, then you are specifying that your app will work for KitKat (4.4) devices, but support as old as Ice Cream Sandwich (4.0.3). There's really no reason to target an API lower than 15 anymore, unless something is very specific business reason to target a device that low. By specific, I mean more distinct than "we want to reach as many as possible."
Finally, there are emulators that you can create through the AVD (Android Virtual Device) manager that can replicate various OS levels and hardware configurations. A very popular emulator company called Genymotion (http://www.genymotion.com/) is also frequently used, however it is not free for commercial use.

create location tracking app for Android: native or phonegap?

We need to create an app, which works for time tracking of the employees as well as location tracking.
We only want to program it for Android, but we don't have any Android skills.
Therefore phonegap came as a great alternative.
But there are several questions, to which I can't find a clear answer in the web.
If the phone is in standby mode, can the phonegap-app still send position data? Would this still be phonegap standard or do I need to use plugins?
the smartphones will be very simple and cheap. Is there a higher risk, that the phonegap application gets closed by Android to free memory then for a native app?
Alltogether, could it be recommend to invest the time to learn Android or would it be better to stay at our language JS?
It’s perfectly feasible to write a location tracking application using phonegap and have it a) work in a performant manner on low spec android phones and b) keep the app running in the background when the phone is in standby mode.
To keep the app running in the background on android, it’s necessary to acquire a partial wakelock (see android powermanager). In phonegap, you need to use a plugin to achieve this. On the plus side, there’s an existing phonegap plugin to do this. The downside is that in order to use a custom plugin, you will not be able to use the convenient phonegap build method to build your app, so will need to do the manual process via the Eclipse IDE, but this is not a great hassle to set up (see here).
In terms of your app getting closed because of android running out of memory, and also having it perform responsively on cheap, low spec devices, this won’t be a problem so long as you are careful to write your javascript code in an optimal way. I’ve implemented a location tracking app using phonegap which uses custom maps and in testing on older android devices including HTC Desire and HTC Wildfire, performance was acceptable and the partial wakelock worked - I had no problems with the app getting closed because of lack of memory.
I chose phonegap over native because I’m a web developer so Javascript is more convenient for me than having to start from scratch with Java and the android SDK, and also because I was able to use the same JS code base with appropriate plugins to produce the same app for iOS. Phonegap is able to access GPS hardware on the device and in testing outside I found the average accuracy to be between 4 to 8 metres depending on the device.
Hope this helps!

Categories

Resources