I am building an application with React Native but the app not working well on a few android devices. So I need to see what's going wrong but I don't know how to set up an emulator for a specific device. Are these problems depends on phone's brand and model or it just depends on their android versions?
Its not really possible. There's two major problems:
Software. Real devices don't ship pure AOSP like runs on the emulator. They add patches and features and there's no way to know what they actually run.
Custom UIs. Many phones provide custom UIs like TouchWhiz and the like which can override Android behavior
Hardware. If your app depends on things that are very hardware specific, like GPS or Camera, they could have issues due to hardware bugs.
If you just want to emulate a specific OS version like KitKat, or specific low memory conditions its possible via emulator configuration. If you really need to test on a device, either buy one or use a service that allows you remote control over specific devices. Amazon has a nice device farm that you can rent over AWS.
One of the biggest challenges when developing for Android is the wide variety of devices and "optimizations" manufacturers make to their Android versions.
The Android emulator is based on AOSP (vanilla Android) and was only recently published with Google services included. This is the most clean version of Android. You can use the emulator to test UI scaling for different screen sizes but it will always behave like an AOSP Android. Google packs a bunch of hardware configurations into Android Studio which you can simply select when creating an virtual device. You can always create a custom hardware profile with custom screen size and resolution. Some manufacturers also change the DPI value of the OS causing the UI to be bigger or smaller, keep this in mind when creating a custom hardware configuration.
Further, you can use the emulator to test the default behaviour on different Android versions. Again, manufacturers change their Android usually causing slightly different behaviour.
I assume that your question is focussed on different behaviour of e.g. Samsung phones having crashes only occuring in Samsung phones (Samsung can be exchanged with any other brand here). Unfortunately, there is no simple way to test this but getting your hands on the faulty device. One option is to use a cloud based test lab (e.g. Firebase Test Lab, App Center or AWS device farm) to test your code on the faulty device or rent the device at a local shop. Most bigger cities have companies renting phones and tablets on a daily or weekly basis.
In the end you will need if statements checking for a specific device, manufacturer or Android version or any combination of them and doing something slightly different to fix the undesired behaviour.
I know that this is not the answer you are looking for, but it's the best I can offer. To tell a little tale of my worst experience: I had once a bug were calling a crypto function caused a kernel panic on HTC (?) phones. This means the user opened my app and the phone rebooted. I was required to implement the entire encryption logic again just for HTC with Android 6.0.
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.
I've developed a couple of Enterprise iOS apps for our users in the field. Some have expressed a preference for Android devices over Apple, and I fully understand. I do not have an Android phone, nor do I want to get one and have a second account to maintain. I'm wondering if I can use an inexpensive Android tablet to reliably test an application that will ultimately be running on an Android phone? The app will need to communicate via internet to a server via cell connection or wifi.
Also, any advice for an Android newbie developer would be appreciated.
Yes you could test on a Android tablet but it would be hard to see how it render on a phone.
You could also use the Android Emulator to test different size and android configuration.
Yes. I developed my first major Android app using only a couple of cheap tablet devices. It's fine; the only thing you can't really test is "what happens to my app when a phone call comes in." Plus if you can get the emulator working under HAXM, or some other similar setup where it doesn't work like a tortoise trapped in amber, you can test on a variety of simulated devices perfectly well.
Other things to consider:
You'll probably want to test your app on a variety of different hardware and Android versions, in particular I'd recommend testing on older devices. This means that you friends' old Android phones are a great source of cheap test devices. I regularly gather phones from friends that would otherwise just end up lingering in the back of a drawer as a "spare" that will never actually get used. Bear in mind that you can use all the features of a phone apart from the actual phone bit without a SIM, including a WiFi-based data connection.
You may find that you can find good, contract-free "pay as you go" phone SIMs. I use a provider whose "credits" don't expire, so I have a phone connection for my test devices where there's no ongoing cost, apart from the actual calls I make when testing.
I'm looking to get back into Android development as a hobby, and I'd like to have a device to use for testing. Seeing as the only Android handset I currently own is the original Motorola DROID, however, I'd like to get something a little less... dated.
Buying a new Android handset on a plan with a carrier is an option, as is a used handset. However, I've seen a lot of much cheaper Android tablets that make that route far more appealing from a financial standpoint.
Developing for iOS lets you use an iPad as a test platform for your app that's optimized for a phone, and you have the option to either run in a windowed mode at the resolution your app is optimized for or to run it in a magnified 2X mode.
How does Android handle this kind of thing? Do you design a single app and the interface scales itself in some fashion? Or, as in the default iOS behavior, will it center itself at the resolution that your app is optimized for?
You could skip relying on devices, use Chrome, and change your User Agent. You can even target specific iOS and Android versions 'User Agent', as well as setting the windows resolution 'Device Metrics'
Right click a window, inspect element, sprocket at bottom right, 'Overrides'.
No, to date there's no standard mechanism for an Android device to simulate a different size device.
However, most apps will want to work on a range of devices anyway. You may find it expeditious to do 90% of your work on whatever available device is fastest at installing and running builds while moving the development forward, and then less frequently use a variety of other devices and/or emulators to test for compatibility with other sizes, dpis, Android versions, etc.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Android Emulator vs Real Device
Is it better to test your app on an emulator or on an actual Android device? As in to test your app while you are still developing it.
In addition, does testing on the emulator gives you more computing power than actual devices?
It is always better to test on a real device, as the emulator lacks certain inputs like sensors etc. (especially the older version of it). You will also have problem testing services like In app billing and LVM as the emulator doesn't come with Google Play, and the accounts that can be configured on it are limited.
The best solution is to have a few devices to test on, and use the emulator for testing different screen sizes and how they react to your layouts. There was a Google I/O talk this year that gave you a breakdown of what devices you needed to test on to make sure you have maximum compatibility. I don't remember which one though, sorry.
Concerning the development period,you should test the application on emulator first so that you can test it on multiple targets having different versions eg:2.2, 2.3, 4.0 to find out the loopholes and the resolution issues.
After completion of development you can test it on your actual device for hands on experience.
I would say it certainly depends on your needs. Since you are developing an application that will be consumed not by yourself actually, it will be consumed by your targeted audience and what will they have? They will definitely have real devices to use your application.
There are some features that are not available or really hard to configure on the emulator, like for example you are developing an app that uses a bluetooth feature.
The emulator is certainly designed for developers to test their apps in a virtual environment with limited functionality.
It really depends on the kind of app you are creating. If you are creating a game that requires the accelerometer then a real device would be beneficial. Yet if you are creating an app with a simple layout and you want to test for different screen dimensions and so on, the emulator is pretty good with this.
Yet you should always have a real device, since the emulator is very limiting.
Android simulator provides a platform very similar to the actual phone, so if your application is running in the simulator, it goes to 94% given the same result in the actual phone, except that sometimes there are modules that must be compulsorily test on a phone like the GMap, Push, screen size..
I am an iphone application developer, all iphones have very similar Operating systems, and the size and everything is the same, so I don't need to create applications specific for each iphone.
But with android there are different phones, different sizes, So How can I possibly know that my app works, and looks fine on all these devices
I don't already own an android but I completed my first application using the simulator. Which android phone do u suggest for testing? I am an AT&T user and Iuse an iphone. Can I simply insert my sim-card in the new android to be able to test my app on the device?
The android virtual device lets you change the virtual hardware to match all of the current shipping phones. There are ways to receive device crash reports from a shipped application to help diagnose force closes or other grievous errors.
You need an unlocked phone to use another SIM card. The Nexus One is available unlocked out of the gate, and comes with an AT&T version. The only AT&T (as sold by AT&T) Android phone (Backflip) is stupidly crippled and should be avoided. You can also buy an Android Dev Phone, which is currently "middle of the pack" in terms of hardware. You can also easily find numerous other Android capable handsets - pick depending on your target market. Some phones are now old: for instance, the G1 is on its way out.
you won't need to worry about different screen size . take a look at Supporting Multiple Screen article . I'm not sure for the late ones because I'm also working with Android Emulator .
1 - Take a look at this Google IO session for load of tips on making your app work across devices. It's not that hard at all really
2 - I'd recommend the Nexus One if you need a phone just to develop on. It's representative of what you'll be seeing in devices in the coming years. If you want a current representative phone take a look at the HTC Legend (Mid-end) or the HTC Wildfire (Low-end). There's also the Droid and things like that but you can only get them on Verizon I think. I'm not too knowledgeable about availability in the US, I'm from the UK.