How to test the andrioid app with out rooting the device - android

I am planning to develop and test the android app on a device instead of emulators.
Can i test the app with out rooting the device. Please share your thoughts.
Thanks.

Yes (and good choice by the way - those things are mind numbingly slow), you simply allow debugging (Developer Options) in the phone's settings (specific to device, sometimes hidden), connect with a USB cable, write the app, start the app, choose to run on said device.
The emulators are good for testing the UI on device types you don't have access to, like a tab for example, that may require additional resources like layouts and images. Or, of course, if you don't have any devices.

Related

Difference between running a program in Android emulator and physical device?

I'm starting the studies about android development with Android Studio and I was wondering if it's possible to build applications only running code on a physical device or do I need to emulate others devices in order to avoid errors, etc.?
The Android Studio emulator barely runs in my machine, so I need to know if it is essential for the apps development or if there are other alternatives.
If you need to run on different versions of Android, just what #CrazySports101 mentioned, but also test different screen sizes & resolutions to check UI responsiveness, it would be better to use emulators.
Obviously, you can start development using either a single emulator or physical device, but during your final testing stages, it would make sense to use emulators to test all your device specific usecases.
And yes, there are few limitations with using an emulator, like it cannot emulate network connectivity, other real-time data, such as GPS, sensors, battery issues, etc. Or usecases such as calling, receiving SMS is not possible as well.
If you have a physical device, you can just use that. No need to run the emulator at all. An emulator is mostly used because it is convenient and easy to test different versions of android. For example, some libraries/UI component may behave differently on different phones.
It is better to use a physical device if your app is using radios like Bluetooth etc.
If you just started to learn android studio and your device can barely run emulator, I would recommend you to go for physical device. Emulator makes you possible to try your product on different version of android and screen ratios, but you can not emulate network connectivity, real-time data, GPS, sensors, battery issues, calling, receiving SMS is not possible. But if you are trying to launch a product in a market you should go for emulator as you would need to try your product on different versions as well.

Is it possible to build a DPC without enroling with EMM Community?

Since the process of applying for EMM integration takes an unjustifiably big amount of time and the whole process is described as "incredibly painful" by those lucky ones that went through it, I want to know whether is it absolutely needed to become an EMM in order to have a working Device Policy Controller app (DPC).
If you faced this problem, please share the experience.
I am developing for COSU devices and want to go into a kiosk mode. I am aware of existence of ways of how to do it, but they all implement a bunch of workarounds - this is not an option - I want a controllable, safe and robust way of doing this. I don't care about not having the ability for remote managing also.
You can use Google's new Android Management API to manage Android devices without building a DPC or registering as an EMM.
You just want to write an app that uses Device Policy Owner? That's fairly simple, assuming you own the devices. Just install your app, adb shell in, and run the dpm command to set your app as owner. If you're buying in bulk from a manufacturer you can get them to do it for you in the custom image you install (although you may need to explain what you want, it isn't a common usecase).
Of course everything has its limits. This will work, unless the user manages to do a factory reset. Which you can prevent via the UI, but can generally be reached from recovery modes or from unlocking the bootloader. So its safe from casual intrusion, but if someone really wants to get at your device and they have physical access and time, they can.
It is definitely possible to write your own DPC without registering with the EMM community.
The most convenient option for provisioning the devices is via NFC. for example using a second device, as it is quite simple to write a provisioning application.
See Implementing Kiosk Mode in Android (part 3 and 4)
for a good example.
I had a few problems with some Android 5 devices, but since 6.0 it works quite well.

How does all snapshot applications in google play work without device root?

There are many applications in google play that take snapshot, they work without device root.
Am new to Android development, so I dont know much of what can be done and what can not be and how it's done.
Following is the link on which you can find the list of applications working without device root :-
http://www.androidzoom.com/android_applications/screen+capture+no+root
If you read the descriptions of those products, you will see phrases like "Rooting will be required depending on model". That is because you are not supposed to be able to take screenshots programmatically, though rooted device users may be able to pull this off, at least for some devices.
Another technique, that at least one such app uses, is to involve a developer computer in the process, using the mechanisms in Android used by DDMS and such for taking screenshots. In reality, it is the computer, not the device, taking the screenshots.
For the devices that such apps work on without requiring root and without requiring a developer computer, the authors of those apps are exploiting security holes in individual devices, just like a malware author would.
Check this library.
Their page seems to suggest it can take screenshot without root.
Android Screenshot Library (ASL) enables to programmatically capture
screenshots from Android devices without requirement of having root
access privileges. Instead, ASL utilizes a native service running in
the background, started via the Android Debug Bridge (ADB) once per
device boot.
Edit:
there are quite a lot of posts SO regarding this
Programmatic screencapture on mobile device
Screen Capture in android

How to debug an app on another handset without having access to that handset

I'm making an app for Android in Eclipse. Currently the app works fine on my Droid Incredible, but it does not work at all on my friends' model which I emailed the apk to. Is there a way for me to emulate different phone models to run the app on without physically having them?
Thanks
The short answer is no. The long answer is that emulators are never perfect as they don't simulate the electronics of the devices but the logic in them. You should run automated tests on your device and if possible in physical target devices. There's a service, similar to vnc, i didn't used this service nor do i recommend it, but it exists, it's called deviceanywhere , google it, it offers remote testing on real hardware, but of course it's a paid service.
Another way to test the application is to give a beta version to android forums and get feedback from users, and don't forget to include internal tests and logging.

Want a phone to develop android apps on must it be unlocked?

I want to test my android app on a phone. I do not have an android phone so I was going to purchase one. Question, I can get a phone on eBay etc without a contract will this work to test my app? Or must it be an unlocked or rooted phone? Can I install and test my apps on a phone that has not been unlocked and does not nave a contract?
Ordinarily you can develop applications (but not hack on android itself) on any android device intended for the average consumer.
HOWEVER there may be some difficulty in setting up a user account to be able to do anything at all on the device without putting a (compatible?) sim in it.
A little web searching is showing two potential solutions - one which appears to require root is to manually change the settings database and thus skip account setup.
Another is to use the adb command line to get around the no sim message and launch the settings activity to enable wifi and do account setup that way. It doesn't seem like this should require root.
You might want to make managing to set up a user account a pre-condition for completing the sale, or buy a phone locked to a provider who markets prepaid sims to international visitors.
My guess is if you get an early htc phone like g1 or mytouch or (or google versions adp1, ion, etc) you will be able to get it to work - if it comes to it they aren't hard to root, and they'd be the cheapest anyway as they are out of date. Later devices and other manufacturers, no idea. Of course if you want to target android 2.2 you need a later device.
You do not need a rooted/unlocked phone to test applications on.
http://developer.android.com/guide/developing/device.html
edit: beaten to the punch

Categories

Resources