I am looking to write an Android app for a device that has not been released to the market yet, and so I will not have the hardware to test upon. I have created an AVD (Android Virtual Device) with as much information as is currently available on the web, so assume that this is as like the device as is possible to get.
However, does anyone have any tips or ideas to make the process of developing for this platform as easy as possible? My current apps have been for personal use on my own phone, so can test performance on the hardware etc. which is obviously not possible in this case. Any gotchas to watch out for (apart from the possibility of the device never being released..!!)
Just follow the SDK.
AVD behaves similar to a real device. I really can't think of something it behaved different on a device and on the AVD.
The only device that brought me trouble is the HTC Hero, first phone with HTC Sense. It didn't follow the SDK and they were calls that weren't there. Newer phones with HTC sense doesn't have this issue, as far as I can tell.
Related
I am trying to recreate an issue which is only caused on HTC One XL phone running Android 4.2.2. It is a styling issue which can be fixed with CSS. The problem is that the Chrome Developers Tool does not have a profile for HTC One XL phone running Android 4.2.2.
I do not have a real device! How can I test for an issue that only exists on particular phone running a particular Android version?
FInd someone with the device to test a beta or debug info gathering build. There's three reasons one particular device has issues.
1)Hardware problem. No emulator will solve this as they won't perfectly emulate hardware.
2)Software bug on this device's framework. Since each OEM ships their own set of patches, there's no way to know what is actually running, except for having the device.
3)Something weird in the system of an individual user. Some odd combo of software, hardware, and data. You need that actual phone to fix this, but it generally only effects a handful of users.
But none of these are solvable without access to the device, or a real Eureka moment. More logging helps, but you'd still need to get those logs which requires a device.
I want to get into developing apps for Android because of its large userbase. However, at the moment I do not have a smartphone. I'm also not too keen on getting an Android phone in the future.
What problems could I encounter when developing apps for Android solely using an emulator? I could use my parents' Android phones for the occasional testing, but will an emulator prove sufficient otherwise? Furthermore, is it possible to set up an Android Virtual Device with low-end hardware on my computer to test out apps with low-end phones?
note0: I do not plan on developing apps which require use of the phone's sensors (such as gyros, GPS, etc.) I only plan on developing apps which require internet access for API calls and perhaps microphone usage (I can't give away too many details right now ;) )
note1: I know this question has been asked before on stackoverflow (albeit 4 years ago). However, I feel it is important to revisit the question because emulators, hardware, and Android itself have changed enormously in the last few years.
edit: My main issues are problems like the app looking weird on the phone despite it looking fine on the emulator or working slowly on the phone but working fine on the emulator. Will every app which works fine on the emulator work fine on the phone as well with a similar hardware configuration as the emulator? I'm in particular targetting devices with Android 4.x/5.x.
Without a doubt, the biggest problem is that many functions like push
notifications, maps, geo-location, in-app vending etc. cannot be
tested with an emulator. The reason is that all these functions are
present in the Google Play Services library which is not present on
emulators.
Another important reason for testing on hardware devices is that the
OS implementation is changed by manufacturers like Samsung, HTC and
others, and therefore, certain problems & exceptions are not observed
till a real device is used.
But the most important reason has to be that running apps on an
actual phone is a hell of a lot more fun that it is with the painfully
slow and retarded emulators! One of the most important things about
Android is that anybody with an Android phone can easily explore
computer science concepts by running simple programs on their phone.
It is incredibly easy, even for a novice, to just fire up their
Android device and start exploring the world of programming! Till just a few years back, it was incredibly difficult to debug an app on a Symbian or Palm or WinCE device. iOS is still as retarded when it comes to running the simplest apps, you have to create a provisioning profile to run a Hello World app on an iPhone!
EDIT:
If your processor supports Intel virtualization, then the emulator can be made to run as fast as a real device. You need to check that out. If your PC is low-end in the sense that it does not support such virtualization, then running and testing Android apps will be a painful, tedious experience that will suck all the fun out of the development process.
Emulators do have one significant advantage over real devices - an emulator is able to access web services on a localhost. If you are still in development phase on your local server and have not yet shifted to a publicly hosted environment, the emulator can easily access web services on a local server. All you have to do is put your computer on the same network as the local server and you're good to go. A real device cannot access a localhost; its impossible, as far as I know.
The Android emulator is a true emulator - it emulates sensors as well, so in fact you can test sensor programming (with some limitations) on an emulator. It cannot do things like GPS, maps etc. because those features have been migrated to the Google Play Services library, and they require a valid Google account to be used, which is why that library is not present on an emulator. If you only plan to work with web services, APIs', GUIs' then I suppose an emulator is more than sufficient. Unlike the iOS simulator, an Android emulator generally exhibits the WYSIWYG behavior, so your GUI will not differ on actual devices, although you do need to test your GUI on multiple AVDs' with different screen form factors.
This is related to question Android Emulator vs Real Device
What is the current state of art of Android emulators and what are the differences that developers should be aware of. I'm working on an app that uses bluetooth and thinking of adding a feature related to phone calling. Since I can't afford to test on all real devices so what should be the guidelines for developer to test such apps on emulators ?
Genymotion rocks. According to the blog post of Cyril Mottier it is even much better then the hardware devices.
http://www.cyrilmottier.com/2013/06/27/a-productive-android-development-environment/
I test basically everything on several real devices. The only thing I use an emulator for is making sure layouts look good on the configurations I don't have available(I don't have a 7" tablet, for instance). This is only after just about everything else is done.
Functionality is going to be nearly the same on any real device, and the emulator is no guarantee, since it doesn't seem to act like any real device in some cases(openGL, for instance).
Testing usability on a desktop with a mouse just doesn't make sense, unless you're writing something that going to be using that input method. There's a big difference between swiping with a finger and click-dragging with a mouse.
Even if you have the fastest emulator/virtualizer in the world, how can it be any faster than just picking up the phone next to you?
My boss recently gave me an HTC Wildfire phone for doing an Android version of one of our mobile apps, which is all fine and good, except that the app requires API level 8 (ie Android 2.2), and the phone itself only has Android 2.1 installed. After much googling, I discovered that this phone does support Android 2.2, and carriers will be rolling out updates over the air for this model phone "in the near future".
Since I'm not entirely certain what our lazy carrier's definition of "near future" is, it would be nice if I could download images for particular releases and install them on my phone. Coming from the world of the iPhone, it seems that this should be something rather necessary in order to successfully develop an Android app.
Yet, it doesn't seem that Google offers any Android OS updates themselves. Have I no choice but to wait for the carrier to release an update?
Edit: Thanks for the suggestions regarding the emulator, but I'm asking about testing on hardware only. I already have a working 2.2 emulator image, but I need to test on hardware now, since the emulator does a very poor job of things like video playback and audio processing.
There's a few ways you can test your application on Android 2.2:
1) You can use the Emulator provided by Google in the SDK. It is possible to create a virtual machine of any version of Android with various hardware options. However, the emulator does have some limitations such as not supporting certain hardware options (such as bluetooth) and it's also dreadfully slow to boot.
2) If you have to use an actual phone with 2.2, you can root your phone and flash a custom ROM. I'm not particularly familiar with how to root the Wildfire, or what custom ROMs are available for that specific phone, but Cyanogen Mod has pretty good ROM support for HTC phones, as well as an active forum with tutorials.
No, it's not possible to download images before OTA. You could check CyanogemMod from time to time - they're working on Wildfire support. Also you could use an emulator.
If you are wanting to bounce around with newer versions, I recommend the Nexus One as a dev phone if you can get your hands on one. Or, if you can deal with the constraints, start with a built-in AVD emulator with API 8 until your phone gets the OTA update.
The Motorola Droid is also getting/has 2.2 on it. At least in the States, in seems that most of the phones on Verizon already have it (non-scientific, just from talking to people I know). So if that phone is available, it may be a decent choice.
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.