Accessing Your Test Web Site form Your Physical Android Test Device
Hello again
Well I’m just finishing reading an advance copy of HTML5 in Action and I’ve been testing things out via a variety of web browsers.
Then I thought let’s use the Android device besides me. It’s attached to the network so the browser can see the local test web sites.
Right no problems it’s on a hostname that maps to the HTML5 CNAME in my DNS. So I fire up the Android browser and type in:
Web site not found is the only response.
Much messing about with host files most important of which was discovering that the following works:
adb shell ping <ip-address | hostname>
So I try
C:\DEV>adb shell ping html5
ping: unknown host html5
Then I try
C:\DEV>adb shell ping html5.xxx.int
PING websitedev.xxx.int (192.168.1.150) 56(84) bytes of data.
64 bytes from 192.168.1.150: icmp_seq=1 ttl=128 time=22.5 ms
64 bytes from 192.168.1.150: icmp_seq=2 ttl=128 time=11.0 ms
So the lesson learned is that the host resolver will not pick up the default domain name, and why should it it’s not like its a Windows device.
Back to the browser and
Works perfectly.
Cheers
Sebastian
How to reboot your Android device
Hello
This should be easy really and it is.
- From your development machine connect via a USB cable.
- Run the following command:
adb -s <serialnumber> reboot
So for my cheap and cheerful tablet it is:
adb -s 20080411 reboot
Cheers
Sebastian
Google Map View gives ClassNotFoundException
Good morning
I just added a MapActivity to our Transports of Delight Android application and now when I try and start the application on the emulator I get the following in the logs:
07-17 21:25:58.004: E/AndroidRuntime(665): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{uk.co.simpleinnovation.transports/uk.co.simpleinnovation.transports.MapViewActivity}: java.lang.ClassNotFoundException: uk.co.simpleinnovation.transports.MapViewActivity
After much headscratching it turned out to be NOT explicitly allowing the application to use the Google Maps library as follows:
<uses-library android:name=”com.google.android.maps” />
This resolves the problem nicely.
Cheers
Sebastian
Setting up an Android Development Environment
And so I needed yet another android development environment.
Why?
See this post.
So I used the latest guide on the Developer Tools Web Site at http://developer.android.com/sdk/installing/index.html.
Note that there is an issue though. When you try to install the Android Developer Tools you get:
Cannot complete the install because one or more required items could not be found. Software being installed: Android Development Tools 20.0.0.v201206242043-391819 (com.android.ide.eclipse.adt.feature.group 20.0.0.v201206242043-391819)
To solve this you need to add some sites to the “Available Software Sites”.
Juno http://download.eclipse.org/releases/juno The Eclipse Project Updates http://download.eclipse.org/eclipse/updates/4.2
Also after the installation you get the configuration screen automatically.
Then all you need to do is install subclipse.
http://subclipse.tigris.org/servlets/ProjectProcess
Or just add http://subclipse.tigris.org/update_1.8.x as a new software location.
Cheers
Sebastian
Deploying Development Releases to Real Android Real Devices
The very first version of Transports of Delight, a useful travel companion Android App, is ready to be deployed to our real Android devices for testing.
This is a very minimal featured release being used prototype our development, test and deploy processes.
So how did it go?
Not well at all.
Why?
Well it turns out Microsofts Hyper-V engine does not support USB devices. This means the ADB (Android Development Bridge) cannot access the test machine to install the software.
So what are my options?
- Copy the .adk files via:
- Copy from development machine workspace\<Project>\bin to a physical machine transfer share.
- Copy from the transfer share to a USB drive.
- Attach the USB drive to the target Android device.
- Copy from the USB drive /mnt/usbhost1 to the relevant area, e.g. a backup area.
- Restore the apk backup
- Install the development environment on a physical machine.
So option 2 it is.
This is when the mantra Marcus and I have been chanting in SCRUM meetings for years now shows it’s true worth.
“Deploy Early, Deploy Often”.
Cheers
Sebastian
How to create an Android VM using Hyper-V
Hello, World
As we start to develop Android Apps we are determined to do it properly, that is to maintain a high quality.
One of the things that helps with quality is testing and with testing one of the things that helps is to be easily able to get back to a known position.
Virtual machines are a real boon to this so I have created and snapshotted an Android 4.0 (Ice Cream Sandwich) machine in Hyper-V.
How to do it is beautifully explained in the following blog:
http://blogs.blackmarble.co.uk/blogs/rhepworth/category/hyper-v.aspx
Cheers
Sebastian
Getting the Android Development Environment Working
I was setting up the development environment for the Android version of our new product when I get the following error:
Cannot complete the install because one or more required items could not be found.
Software being installed: Android Development Tools 0.9.9.v201009221407-60953 (com.android.ide.eclipse.adt.feature.group 0.9.9.v201009221407-60953)
Missing requirement: Android Development Tools 0.9.9.v201009221407-60953 (com.android.ide.eclipse.adt.feature.group 0.9.9.v201009221407-60953) requires 'org.eclipse.wst.sse.core 0.0.0' but it could not be found
It turns out you need some optional parts of Eclipse.
So in Eclipse under Help > Install New Software make sure you reference the correct version of Eclipse as well as the ADT toolkit, i.e.: http://download.eclipse.org/releases/indigo.
The link that helped me was: http://stackoverflow.com/questions/4249695/adt-requires-org-eclipse-wst-sse-core-0-0-0-but-it-could-not-be-found
Good Luck
Sebastian