This is part two of my example of communicating between android and a pc over usb. This shows a simple java client based on this oracle tutorial and I use it to test communication between android and the PC. Here’s the code: package com.rga.vzw; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintStream; import java.net.Socket; import
Category Archives: android
*Update* There is some new documentation on the android dev guide. I suggest you start there. http://developer.android.com/guide/topics/usb/index.html This will be a two part mini tutorial on how to establish device to host computer communication through usb by using adb. A lot of this is based on Alex Florescu’s work on the subject. My thanks go
When you create layoutAnimations and you set the fillBefore or fillAfter in the animation sets referenced by the layoutAnimation the xml attributes of dont work. You have to set them through code. //doesn’t work! You have to set through code: LayoutAnimationController layoutAnim = AnimationUtils .loadLayoutAnimation(this, R.anim.landingpage_right_anim_out); Animation anim = layouAnim.getAnimation(); anim.setFillEnabled(true); anim.setFillBefore(true); anim.setFillAfter(true);
If you ever need to launch another app from your own it’s actually easier than you think.
The PackageManager class provides some handy methods that make this a snap.
SCREEN_ON / SCREEN_OFF intent filters do not work!
Sometimes you will need to know when the user turns the screen on and off.
A quick google search leads to the intent filter
How to read an xml from the sdcard and parse it using XMLPullParser.
At some point you’ll find yourself needing to get information about the activities running in a certain taks.
Here is a quick and simple way to have videos play one after another in a loop.
Here’s a great reference for working with the TabHost control Learn Android: Tabbed Applications in Android.
everyone knows about handling events via onClick. onClick works fine and all but it’s a little slow. The event doesn’t fire until you’ve actually released (finger or mouse) so you have to first tap and then let go for anything to happen. What if you want your button to respond immediately after you touch it?