How to connect to ADB via WiFi

How to connect to ADB via WiFi

Jul 31

Today I was hacking away at some updates to some of my apps – after accumulating several devices over the last few months, testing my app looks a little something like this

Picture got photobombed by actual Androids (how awesome is my makeshift non-keyboard shoebox stand?)

I was always under the impression that to establish ADB you needed a USB cable – turns out that’s not true.

If you have a rooted device – simply installing something like ADB over WiFi enables you to connect to your device from your PC

I’m now no longer running low on USB slots.

Advanced Topics for Android Devs

Advanced Topics for Android Devs

May 12

Great video from Google I/O 2011 highlighting advance tips and tricks all Android developers should be considering when developing great applications.

It’s all about making your applications fresh, psychic, adaptive and smooth.

Can’t wait to try some of these tips in my next app :)

Storing files on SD Card

Storing files on SD Card

May 03

Ever since I started using Android – I always thought it was a bit chaotic how different app developers handled their files differently when storing them onto the SD Card.
After using my phone for a few weeks, my root directory had about 10-15 random folders and I felt bad deleting them because I wasn’t sure what they were.

When I started developing, I dug through my SD Card and noticed within Android/data there was a nice structure of google/android applications with their java-style package name (like com.google.android.apps.maps)
So I stole this pattern and used it for my apps – storing all my cached images/files etc under Android/data/com.jamesgiang.xyz

My suggestion to all you developers out there, if you aren’t doing this already - please adopt this habit!

Why? Because I just found out that, if the user is running Android 2.2 or above, this directory will be automatically deleted when they uninstall your application.
Although user’s uninstalling your application is  a bad thing, as an Android user as well, having random folders sitting around your SD card can be pretty annoying.

Read more about it here on Android Developers

Writing and reading files

Writing and reading files

Nov 14

Been a busy weekend hacking on a project, a bit of Android development and a bit of web development.

Sadly I spent some time just working out how to read and write data to a flat file on Android. So I thought I’d share the code snippet I’m using

public static void WriteSettings(Context context, String data, String file) throws IOException {
	FileOutputStream fos= null;
	OutputStreamWriter osw = null;
	fos= context.openFileOutput(file,Context.MODE_PRIVATE);
	osw = new OutputStreamWriter(fos);
	osw.write(data);
	osw.close();
	fos.close();
}
public static String ReadSettings(Context context, String file) throws IOException {
	FileInputStream fis = null;
	InputStreamReader isr = null;
	String data = null;
	fis = context.openFileInput(file);
	isr = new InputStreamReader(fis);
	char[] inputBuffer = new char[fis.available()];
	isr.read(inputBuffer);
	data = new String(inputBuffer);
	isr.close();
	fis.close();
	return data;
}
Share function on Android

Share function on Android

Oct 06

How to use Intent.ACTION_SEND in your android application to quickly share information.

This is a great way of implementing a simple sharing function because it requires very little work from your end as a developer.

Page 1 of 212