Day 5: Creating GUI using GridLayout

Today’s exercise involved creating a GUI using the GridLayout and LinearLayout containers. I now have a pretty good idea about how to use these layouts to create a basic GUI and set its properties using the Outline and Propertes windows in Eclipse. I probably mixed something up though because my layout looks ugly. :P Something is obviously broken in some configuration which I need to fix. Remind me to never become a GUI developer because I’m not looking forward to this. Haha.. Tomorrow I will code up all these controls to work as designed.

TipCalculatorGUI

Tags

Related Posts

Share This

Day 4: Hello World

Or rather – creating the “Welcome” app in the Deitel & Deitel book. This was another code-free day (*sigh*) but I did get through Chapter 2 which involves learning how to use the Eclipse IDE to create a very basic app that displays some text and two images.

A summary of what I learned:
1. Using the Eclipse IDE. So far it is very similar to Visual Studio (although not as nice and feels a bit cramped).

2 Using the relative layout component.

3. Placing and customizing a textview control and two image controls.

4. Creating an accessible app by making sure all the components have text that can be read back if Android’s TalkBack feature is enabled.

5. Building a relatively simple app without writing a lick of code. This is what it looks like:

 

 

WelcomeAppEnglish

 

5. Creating a localizable app by separating the strings into separate resource files. Also, creating a Spanish version of the app.

WelcomeAppSpanish

 

 

Tags

Related Posts

Share This

Day 3: Successfully running test app

Today was another short day wherein I was able to get past all the issues of the previous day. The one thing I had set incorrectly in my configuration was to run Apps at API level 20. Since all the Deitel apps were built with APIs at level 18, they were crashing when I tried to run them. I fixed this and all was well! I successfully ran the Doodlz app on my machine and interacted with it just fine. I was able to run it on both the Nexus 4 and Nexus 7 emulators.

This is what an emulator looks like. (A lot like an Android device’s UI.) I was pleased to find that it responded to the touchscreen monitor of my X1 Carbon laptop. It’s much easier and more natural to interact with it that way rather than using a mouse! I’m not sure what the buttons on the right side of the emulator do because I’ve never gotten them to work.

Nexus4Emulator

Here is an image of the doodle I made via the Doodlz app. It is reproduced exactly as shown in the book because apparently I have zero motivation to experiment and am just keen on moving to the real thing.

DoodlzPicture

One thing to note: The emulator needs to be started up and left running. The startup time is very expensive compared to say starting up a real physical device. If you need to shut down your machine or re-start it to install updates, I recommend starting up all the emulators you need well before you need them.

Tags

Related Posts

Share This

Day 2: Running a test app

This will be a very short post filled with much angst. :P

Long story short, I tried to run one of the Deitel&Deitel test apps in the Eclipse Nexus 4 emulator and failed miserably because it was soooooo slow and refused to load. I’m really surprised to see how terrible the performance of the emulator is compared to the Windows Phone emulators which are as quick as using an actual device. I believe it has something to do with the fact that WP8 runs emulators on virtual machines so the run natively.

Anyway, Day 2 was not much fun. On to Day 3.

Tags

Related Posts

Share This

DAY 1: Setting up dev environment

Well, we seem to be live.

First up – the point of this blog is to document my journey into developing a full fledged Android app. My hope is to go 0-60 in 30 days, so to speak. I’m starting with absolutely no prior Android development knowledge and at the end of 30 days, I hope to have a non-trivial full-fledged app done and shipped to the store. We shall see whether I succeed or if I bit more than I can chew.

I should clarify that I am new to Android programming only, not coding in general. That said, I last code in Java circa 2001 and I’m willing to bet that a couple of things have changed with it since then. My last coding experience has been with C# back when I developed test tools for my Big. Company. job after years of being somewhat stuck in roles that didn’t need much coding and surrounded by people who didn’t write much code. Long story short, my coding skills have gotten quite a bit rusty over the years. I still enjoy writing code though and love that little thrill you get when you create something that didn’t exist before or when you come up with a particularly elegant way to solve a problem.

The other question is probably – why Android over iOS or well Windows Phone? Off the top of my head, here are my reasons:
1. I already know Java even if my knowledge is old.
2. There is a big community and a wealth of knowledge out there for Android developers.
3. I don’t need to purchase new hardware. Developing iPhone apps requires you to own a Mac which I didn’t want to get for various reasons. I do own an old Mac desktop that I bought specifically for iOS development a while ago but I’d rather develop on a laptop right now. iOS might be the next step after I’m done with Android.
4. Android has the biggest market share.
5. I like Windows Phones and I’m already familiar with the dev environment but their market share is still not very big and there just isn’t enough of a dev community out there yet. I dabbled in developing a WP8 app last  year and was constantly roadblocked when I would run into an error that I couldn’t go look up on Stack Overflow.

I see my progression for the whole mobile dev experience being first Android, then iOS, and finally WP8.

 

Anyway, today is Day 1 of the 30 day challenge. What I accomplished today was:

1. I purchased the Kindle version of this Android app development book: Android for Programmers: An App-Driven Approach by Deitel & Deitel. I picked this book out of the scores of books out there because:

  • I last studied Java via a Deitel & Deitel book
  • The book was published this year (2014) so it probably covers all the latest developments
  • I like the sound of their approach where you build progressively more complex apps in every chapter
  • I didn’t want a book that went through a bunch of  programming basics for absolute n00bs since my basics are just fine. I just need to refresh my knowledge of Java syntax and I hope that going through the samples will be adequate. This might of course totally backfire and I might have to look for another book that works better for my level.
  • I picked the Kindle version so that I didn’t have to lug a physical book around and so that I could just Alt+Tab back and forth between the IDE and the book. I imagine I should also be able to copy-paste code for when I don’t feel inclined to type it all out by hand. It sucks that I won’t be able to re-sell the book when I’m done, but the princely sum of $20 seems like a worthwhile investment into a fun hobby+possible new career path.

AndroidBook

2. I set up my dev environment on my dev laptop. This is a Thinkpad X1 Carbon Touchscreen Ultrabook which has an i7 processor, 8GB of RAM and runs Windows 8. This sweet machine is what I had at BigJobCo and I decided to purchase one for myself because I liked it a lot. The configuration should be good enough for doing dev work. Setting up the dev environment involved:

  • Installing the Java Development Kit (JDK) from here. I did have to point my PATH environment variable to the bin folder of the JDK installation to make sure that Eclipse could find it.
  • Installing the Android SDK/ Android Development Tools (ADT) bundle from here. Having the bundle was really nice. I had an epic fail experience of trying to set up this dev environment a couple of years ago where I gave up in frustration after being unable to resolve a bunch of dependencies. This time around, the installation was smooth as clockwork though.
  • Installing Android Studio from here. I got this even though the book was going to use Eclipse rather than Android Studio. I figure it will come in handy when I start doing the official Google tutorials.
  • Configuring Eclipse to show line numbers and ensuring that the compiled code was compliant with Java SE 6.
  • Installing all the extra packages under Android 4.4,  Android 4.3 and Extras that weren’t already installed. This can take quite a while so do it while you have an hour or so to spare.
  • Creating emulators (Android virtual devices) for the Nexus 4, Nexus7 and Nexus 10. The emulators are supposed to be pretty slow. I’ll find out soon enough, I guess. Unfortunately I don’t have an Android test device right now. My old HTC Droid Incredible is probably hopelessly old and I can’t imagine that it will run the latest OS version. I cracked the screen and digitizer of my Nexus 7 so that one’s out too. If I find that the emulator is unbearable to work with, I suppose I will try to pick up a couple of cheap used Android devices to test on.

And that’s it. Day 1 is done! As the days go by I should have a better idea of how long I will spend on this per day, what app I eventually want to build, what theory I need to brush up on, what blogs I need to follow etc. etc. It should be a fun ride. :)

Thanks for following along!

Tags

Related Posts

Share This