Archive for the ‘ Android ’ Category

Rooting Telstra’s HTC Desire and adding Froyo 2.2

From what I heard about rooting android phones, it seemed way complicated and messy. This was the time before Unrevoked – people were required to make ‘gold’ cards from SD, then flash their bootloaders, get roms, install roms, and it seemed rather complex.

Unrevoked makes the rooting process a one click affair. Using the mac app (download it here), I connected my Desire via USB in USB debugging mode, clicked the .app and waited for about 10 minutes. The phone becomes rooted that easy. It will also install a new bootloader in which you can then put custom ROMS onto your Desire. The most painful thing for me was that Telstra really wants to drill it’s logo and branding everywhere, and getting rid of those stupid apps was the most important thing (along with Apps2SD :) ). So I decided to go with a Nexus build of Froyo, the first one I chose was ahmgsk_froyo.

A few things happened. I didn’t really read much about the process, I think I was a little too excited to bother. But I should have, because I thought I totally bricked my phone. Turns out you need to wipe your data and cache as the ROM was stuck on the Nexus load screen (which looks damn cool) and I was wondering what was going on. To further familiarise myself with the service, I then proceeded to load Defrost’s Nexus Froyo build, which was really new and thought if I was going to get a ROM, might as well get the lastest. So I put that on, finding out you can back up your data using the unrevoked bootloader under nandroid. My advice is to backup everything using that  nandroid option in the bootloader, in case you fuck up :)

So I’m pretty happy with Froyo, and further customisations available to me. It does feel a little faster, but I do miss some of the Sense UI stuff especially the camera app which is better than the stock Nexus. There’s rumours that the new Desire Froyo + Sense UI will be out in Europe this weekend for unbranded phones, which I can get my hands on for a reflash. The Nexus ROM does have some cool features, I like the Gmail client with Froyo, and the Gtalk will sync conversations and replies made from another client (my desktop for example) so my conversations are no longer fragmented. This is probably the best feature for me. There’s also Chrome to Phone, figuring out how to use that, not really sure what it does. But the best thing is,  having a rooted phone means more apps because there’s more control over your phone. eg: Titanium backup, and finally a screenshot app. Here’s what my phone looks like now.

You will also need to change some of the settings to get HSDPA to work on your phone. It’s an easy process that you have to do in the Settingss > Wireless and Network > Mobile Network > Access Points – all the Telstra settings can be found on Whirlpool here.

I would suggest you give it a try if you are thinking about it, the chances for bricking are low if you stick with unrevoked and the defrost ROM, it’s really a 2 click process!

Android Development (from noob, to less noob) pt1

For the past week I’ve been making an android application on my fancy Desire phone running Android 2.1 Google’s phone operating system, manufactured by HTC from the Telstra Network (throwing in company names there in case I can get some free shit from them). It’s basically a contact list type application so that you can contact people within the organisation without needing to add them to your phone contact list, separating your personal contact list and work contacts. I feel that there the function of separating your person life and work life is very important, especially when your best friend’s name is John Miller and your boss’s name is John MacIntosh, a misclick and understood message could get you into a life of strife. I also don’t see the usefulness of having work contacts in which you only need to call Mon-Fri taking up space on your contact list. So essentially the loose brief for this app  is to create a contact list of people within the organisation.

I’ve never really developed anything useful before, or outside of university life. The software development cycle is a conceptual idea to me and I’ve never really live through it. However, upon returning to the lifestyle of work and/or working for ‘the man’, I’ve had to make sacrifices and do what ‘the man’ tells you to do. Which includes returning to the spiteful days of using java… (I remember those days. It was a dark world out there).

Of course, being Google technology, there’s a LOT of tutorials out there. This is great to start learning the android environment, the java coding complexities, and understanding how everything works. There’s also the assumption you actually know stuff, things, whatever. If you’ve been out of the loop like me, then well… you’re pretty much screwed. So what I really wanted to write was a somewhat meaningful post about my experience with the android platform and creating a noobish application for it, in terms that the local Penshurst butcher could understand (maybe there’s free sausages for me).

To begin with, you need an IDE. I don’t know how anyone can deal with Java without an IDE (Integrated Development Environment). I would say it’s impossible, and if someone actually manages to build applications without an IDE, well I have a new god to worship. In short, Java is confusing and an IDE is required. The IDE of choice is Eclipse, and there’s a reason for that. Google has been nice enough to give us a tutorial in how to install the Java SDK, Eclipse IDE and the plug-in’s required. You can find that link here, I see no point in reinventing the wheel. I will summarise it; you’ll need to install Java SDK, then get the Android SDK, install Eclipse, do some settings and install some plug-ins. Then you’re ready to tackle some tutorials.

To get anything working, you need to create an Emulator (also known as Android Virtual Device or AVD). This will create a window in which looks like an Android phone, so you can test your application. To do this, you need to install the AVD plug-in which you should already have, then in Eclipse go to ‘Window’ in the menu and there’s an option for the ‘Android SDK and AVD Window’. Here you’ll be able to create an emulator of an Android Version. I’m using 2.1 because it’s the version my phone uses, and the phones in the company are using. It’s safer to build something in earlier versions, usually applications are forward-compatible so this application would run on anything 2.1+ (including the new 2.2 Froyo build).

Now, if you wanted to run and compile something, you’ll need to point your application to that Emulator you just made. Starting an emulator takes a bit of time, it might look like it’s frozen but it is doing something. So that takes care of building an AVD and running/compiling an app. When compiling your code, make sure you have a .java file selected in your /src directory and not an .xml file, because often using the ‘Run’ command will compile just the xml and fails, making a .out.xml file or whatever. I’ve done this often when adding Activities to my Manifest file and not realising, and Eclipse will try to render the XML file and give you errors, and make a new .out.xml which you need to delete. This might not make sense now, but when the problem happens, you’ll be glad you knew this.

The Manifest file is important. I never really understood what the function of it was until I made something. The manifest file is an XML file that is automatically generated when you first create your android project. It does need tweaking however, for every Activity (Class) you make in your project, you need to write this into the Manifest file. Why? Well I believe the Manifest is the file that gives permissions, themes, labels and what-not to the Activity. Also, your application won’t compile without it, so if you’re stuck and wondering why your application doesn’t compile and you just added a new class, then this is most likely your problem. It also gives permissions to your app.  Once I find a good code snippet embedding plug-in for WordPress, I’ll post it below.

To create User Interfaces, you don’t need to create them in Java (thank god, gone are the days of swing!). You will make them using XML. You can find this in the res/layout directory. I would suggest playing around with the ones on the google android resource site, it has many examples of different views and the link can be found here. I’m a graphical user interface-y person and coding interfaces seems difficult for me at the moment, I am waiting on the App Inventor to provide me with a drag and drop interface builder in which I can then copy and paste the XML code.

So to finish up part 1:

  1. Install the SDK’s, Eclipse and the Plug-ins
  2. Create an Emulator (Android Virtual Device)
  3. Create a Project
  4. Ensure that Manifest file is kept up to date with your changes such as adding Activities.
  5. User Interfaces are made with XML