I've developed my first app and it worked fine on my phone (Android 2.2). When I tested in a Xoom (Android 3.2), it had lots of bugs, though. I need this app to run in many different versions of Android. How can I develop it and make sure it will, having only an Android 2.2 in hands for tests?
Developing with the last version targeted in the manifest while keeping a close eye to back compatibility is how you achieve this with the best efficiency.
Many libraries (ActionBar Sherlock, NotificationCompat2, ....) will help you in making your app back compatible without issues.
I strongly recommend making the app for the last version of Android so it is ready when this version gets some steam instead of targeting whatever version is the most popular right now. It is a bit more work at the beginning, but it will save you many headaches later on.
The emulator will help you test this, the best configuration is to have a terminal with the last version of android at your disposal (this is why the nexus are a very good choice for a dev) and different configurations on the emulator to test back compatibility or other form factors.
Related
I've never made an app before and am looking to get into it. I also need to upgrade my phone because it's really old. I've heard people say that it is best to test your app on stock android. But I really wanted to buy a Huawei, which might be running an older version of android not stock. What extra benefit would I get by spending the extra $500 to buy a Google Pixel phone for testing. Or is it fine, if I go ahead and test my app on a Huawei? What would be the pros and cons?
Android is an open-source operating system, which means companies can modify it to their liking. They do so by adding what’s known as a custom skin or user interface on top of the OS, which changes its look and feel as well as adds new features. These skins include Samsung Experience, HTC Sense, EMUI (Huawei), and OxygenOS (OnePlus), to name a few.
Some skins, like Huawei’s EMUI, change the overall Android experience quite a bit. For example, until EMUI 5.0 came along, owners of Huawei smartphones didn’t have an app drawer. All the apps installed on a device were placed on the home screen, just like on iPhones.
With stock Android, you get none of that — you only get the features developed by Google.
You can see the comparison of "Stock OS" and "Forked OS" here
https://www.androidauthority.com/what-is-stock-android-845627/
https://www.digitaltrends.com/mobile/what-is-stock-android/
With stock android, you get updates a little faster than other OS.
Coming to your scenario, you can even test an Android App without a physical device and by using Android's Emulator(Virtual Device) which has an Android Stock OS. You can select any version of Android(latest to old) and test your app there. If you are looking only for the purpose of testing I would not recommend you to buy PIXEL you can go ahead with your instincts.
People say it is best to test your app on stock android because the functionality you implement in pure android must work in the other OS as it is a layer on top of the stock OS but there are some chances(very few & negligible) that the functionality you implement in other OS might not work in stock OS. You can always use an Emulator for testing.
I am an Android developer. In my 5 years experience, I used both pixel and Oneplus, I did not find any advantages for stock android over Oneplus's Oxygen Os.
So, I'm current trying to learn and become a programmer. I've recently worked with C# but I really want to get into mobile apps, since most small projects really tend to fit better as mobile apps, rather than desktop apps.
The easiest, for me, seems to be the Android platform, but I'm having a problem... I don't own an android phone, but I could possibly purchase an old model. Naturally these will have an older version of Android, so here is my question...
How compatible are these different versions? Like, are there major differences when moving from Icecream Sandwich to Jelly Bean, or from KitKat to Lollipop?
How do app developers deal with this array of Android versions?
When you develop an app for an old version of Android, it will run without errors on all newer version of Android, unless you do something involving low-level stuff like direct kernel calls, but you will never encounter such issues if you only use Java.
Worst issue you'll see is your app visual style looking outdated on newer devices.
If you target API level 23 / Android 6.0 Marshmallow, you will still need to run your app on Android 6.0 emulator, to be sure that it won't crash when using new Android permission dialogs to ask for SD card access etc.
I am trying to test my app and I have lots of problems with Android emulators. Finally, I got one emulator running using Android 2.2 . So I used this one and my app works fine.
I also tested my app using real device, Nexus 7 , Android OS 4.2. App works fine in both versions.
It is safe to consider my app will run fine for OS versions within 4.2 - and 2.2 band? The reason I am asking is because using emulator makes my computer very slow and it takes forever.
In the best case: yes. In worst case: no. It completely depends on the parts of the Android API you're using in your app. For example, private APIs might very well break or change. You should be fine with public APIs, but there's always the chance of a bug in one of the OS versions...
If you want to test your app on various devices and Android versions, you should give apkudo.com and testdroid.com a try.
You can also try https://www.elusivestars.com it allows you to select devices based on specs like OS version, brand... and offering 5 free reviews
I have heard good things about testflightapp, they used to be iOS only and now doing Android.
Something like http://www.perfectomobile.com/ might also be a good way to go.
Here is a list of tools, including test tools
http://www.apptamin.com/blog/app-developer-tools/
Cloud based real device testing is typically either devices you can access and manipulate/automate or users with devices. Personally I think starting with automated testing then finishing off with real user (usability testing) may give you good coverage.
I am the Founder of elusivestars
I am a beginner on android programming. I am at the first at all. I wanna learn some important point.
Now, I am installing the programs and platforms which I need to develop Android Apps. On the SDK Manager there are few options to download Android API.
Which one should I prefer? I want to that, my app will run on all android roms and versions like ICS or JellyBean.
Thanks!
In order to support as many users as you can, you should opt for the lowest version API, since apps written for an older version of Android will work for future versions as well (although they may not be optimal). Once you need a feature in a later version, you can increment your minimum SDK version.
I would look through the different SDK versions (e.g. 2.1) and see which features (and/or permissions) you need for your app.
Keep in mind that older phones may not have certain capabilities, and you may not be able to support them. Therefore you should weigh if what you're adding is worth alienating the users you will no longer be able to support. Android provides a table of market share per version.
You mention that you want to support ICS (4.0) and Jellybean (4.1 and 4.2), which together control a little less than 50% of the Android market. It is worth looking into supporting Gingerbread (2.3) as well for another 45%.
Another option of course is to branch your code depending on the user's OS version, but this requires a little more maintenance work. However, if you are supporting pre- and post-Holo-themed versions (ie for the action bar), it may not add that much overhead.
It really depends on your target market, purpose, and familiarity with Android.
Android maintains forward-compatibility which means an app designed for 2.1 for example will work on later versions (in most cases). However there are some features added in later versions which are only supported starting with a certain SDK version.
This page may be helpful for you
I'm about ready to release 6 apps on the Google Play market, and a guy at work brought in a new phone that was running a version of android that the manifest file stated was supported and it didn't work as expected even though it did work on the emulator. This brought up the question of
Short of buying every device, how can we ensure that our apps will work on all devices that run the versions of android that the manifest file says it supports?
Is there a suggested way to do this? The combinations of different screen sizes, densities, and android versions can make development for android a real pain.
Edit:
The part that "didn't work as expected" was some of the javascript calls. Especially calls like window.width and window.height, the width was reported as the height and the height was reported as the width on 2.3.4, but not 2.1, or 3+. Another issue, also with 2.3.4 and javascript was the window.open(url, target) call would only call the shouldOverrideUrlLoading on my WebViewClient the first time for each target rather than every time. Again, it worked with 2.1 and 3+.
Currently, I test on devices running 2.3.4, 2.3.5, 4.0.3, and 4.0.4. I also test on emulators running 2.1, 2.2, 2.3.3, 3.0, 3.1, 3.2, and 4.1 with various screen sizes and densities. The javascript bugs are not present on the 2.3.3 or any of the other emulators, which is why I would rather test on devices, they give me a more accurate feel of what the user will run into
To start, here is a presentation that discusses how to potentially address the problem. This is obviously not easy, but here is another similar SO post.
I don't exactly what you exactly mean by "didn't work as expected" but this can help you quite a lot:
In my opinion, the best way to test your Android application is to install a Jenkins Continuous Integration Server, and use the Android Emulator plugin to execute the application on your application builds on emulators with various settings (screen density, OS version, etc.). The plugin can take automatically screenshots so you can see afterwards how your application looks on each configuration. Also, builds and testing can be trigerred daily, or each time you commit some code on your SCM (Git, SVN, you name it).
The configuration of the plugin is detailed on the official page: https://wiki.jenkins-ci.org/display/JENKINS/Android+Emulator+Plugin