Learning Android: Part I
1I will use this post to talk about my ‘Getting familiar with Android’ learning. As announced in the last post, I’ve started learning Android, but not even at half-pace as I wanted to.
Anyways, let me tell what I’m doing in learning. I’m using ADT on Eclipse Helios and using the Emulator for testing purposes. Currently focusing on the samples present along with Android SDK. Gone through the Application Fundamentals available along with the SDK.
Interesting Things:
- Most importantly, its good to see myself learning the things I’m interested in from the start (FYI, I always have that thing for Web & Mobile Development)
- Very clear & highly helpful documentation (and, also downloadable). And the docs are developer-focused & also lays emphasis on good practices at every step, like i18n, using resources instead of hard-coded strings etc. etc..
- Separation of layout of the app and the application logic (supports XML files for layout). I get the feeling this is inspired from Flex (mxml & as), but I don’t know.
- Provides a very good mechanisms for interoperability between various applications. Simply said, I can use the capabilities of other applications installed, and also I can expose my app’s capabilities to other apps. Also, Android search also integrates good with any application’s search.
- Application Development is done in Java, which is said to be a very developer-friendly. I can utilize this to brush my skills in java, as I have other plans to work in Java in some not-so-far future.
Annoying Things:
- Tabs are NOT simple to use. I’d prefer a way to declare tabs and its contents in the XML itself.
- In TabHost, mandatory referencing of elements to’ tabs’ & ‘tabcontent’ doesn’t look like a good programming feature.
- Missing the tabs & tabcontent id referencing in the TabHost would give no error / warning by Compiler, but fails at Runtime, without any proper information (even while debugging)
- Emulator takes very long time to start. So, its preferred not to close the emulator after every run. (start along with eclipse and close it before closing eclipse)
- Emulator keyboard shortcuts – Not too easy to remember (like, Ctrl + F12 for Toggle Portrait / Landscape modes). I’d have preferred if the emulator itself has a help button, to show the shortcuts.
- Nothing to do with Android, but the bug in Helios (Eclipse Web tools plug-in) has become a pain, forcing me not to us any features while editing resources. Bug – https://bugs.eclipse.org/bugs/show-bug.cgi?id=318108
- Again, may not be related to ADT (frankly, I don’t know), but the auto-complete context is very slow, taking 30-60 seconds (which is tooooo long, btw). Here again, I’m forced to disable Auto-Activation of context Assist at ‘Window -> Preferences -> Java -> Editor -> Context Assist -> Enable Auto Activation’
- IĀ can’t run the application when my focus is on layout files (on resource files, for that matter). I always need to switch to a java file, to run (Ctrl + F11) the application
- The layout filenames cannot contain uppercase letters. If it contains, the error shown doesn’t help in identifying it
Unclear points for me:
- In Android XML, for TabHost, @android:id/tabhost works ( i.e; referencing other element with tabhost id ). How can access this element from my Activity class? (since, no reference is created in R.id )
- Is XML compiled ? Or interpreted at Runtime? If compiled, how can I see the generated Java (?) files? (something similar to -keep compiler option in Flash Builder)
- And many other things (like, working of Intent, i18n, logging), but these are somethings I need to learn as I dive further in android..
Tasks for coming days:
- Finish the Tutorials in the resources, and then go to the samples folder available with the SDK.
- Try to make a couple of simple *usable* apps, so that I get enough practice with the SDK APIs
Also, attaching the projects HelloAndroid.zip and HelloViews.zip I made during my learning.
Wish me that I gain pace in learning Android over the next few weeks…
And, I’m back!
0I’ve decided that I need to celebrate the release of WordPress 3.0. So, I’ve given a thought about the best way to celebrate! And guess what? Using it & spreading the word will the best (both for myself & WordPress too
). So, I’m back to my blog. And this is not like my previous times !!! I’m going stick around updating my blog for quite some time (a couple of months, for a minimum).
Let me start with what happened during last few months. Actually, many of them I wish they didn’t happen or they happened other way..
- I tried to get a driving license at Noida, but failed because of lack of local address proof. Seriously, going back to my hometown just for getting a license – doesn’t it sound stupid?
- With no license, my dream of a getting a bike got wiped away !
- I’m getting bored (read as vexed, irritated and so on…) of Noida ! What a stupid place it is !! Isn’t it?
- Laptop is troubling me a lot…. Currently under repair. Wish I get it back soon!
- Lost all the contacts from the mobile!
And the good part: Google I/O 2010 brought back my interest in Web & Mobile development, due to which, I decided to spend atleast 40 hours in the coming couple of months learning Android. I’ve also decided Learning is going to my major focus area for a couple more years!!
So, wish me luck in putting things into execution !
The Benefits of Failure
1This is video of the speech by the famous J.K. Rowling at the Harvard Commencement, 2008.
So, whats in the video?
- It has some humor in it, especially the first 150 secs. I’m sure a few smiles you’d certainly escape from your tender lips..
- She talks how ‘being poor’ influences (or atleast attempt to) your life and all in it including career, passion etc. etc.
- And the core part – The benefits of failure. I think she had put this part in action in a great way, or else, after watching this video, why did I desperately want to fail in a big way despite my fear of failure??
Now that I mentioned I fear failure, let me tell what my mind tells me right now. “You do not fear the failure itself, but your fear its after-effects. Its capable of taking everything fro you !”. But my heart is encouraging me – “When you had done everything from scratch, why do you fear to do it again? It’d easier this time.. !!”
I know it sounds funny, but really can’t help. Perhaps, this is why people call – “An idle brain is the Devil’s workshop”
I had a problem
0Symptoms:
- Language: C++, Operating System: Windows
- Target Audience: Programmers
- Sub Area: Reading ASCII / UTF-8 files from the disk using C++ streams.
- Trouble: How to handle files whose file names contains non-ASCII characters?? (coz ifstream takes a ASCII file path
)
Solution:
- Use _wfopen_s(), the safe version of _wfopen(), which takes a wide-character file name & gives a FILE pointer i.e; FILE*.
- Use the obtained FILE* to create a stream, like ifstream in(fp);
- We used wide-character file name & are reading the file byte-by-byte (actually, its char). DONE !!
BTW, I got help from here ! Hope this savesĀ time for someone out there…
QuickPost: Torrent sites I use frequently
0A quickpost to announce the torrent sites I use regularly (and of vourse, I like them)
- http://www.vertor.com Its the home for verified torrents. Hence, you need not worry about fake torrents. It also have screenshots and an audio sample. And the best thing, it does not need any registration and almost ad-free.
- http://www.telugutorrents.net As name suggests, its dedicated for Telugu, a regional language in India (and also my mother tongue). Good part about this site is: Only good quality (dvdrip) videos are allowed to be posted here and no place in here for camrips, which is a good feature as far as I’m concerned. Also, downloads happen with a very good speed. Sad thing is it is open for registered users only, and registrations are closed now !!
- http://www.tollytorrents.com Again, a telugu only site, but contains all the entertainment stuff (like, music, dvdrips, camrips, wallpapers etc.) . Though requires registration, registrations are free & open. Downloads happen at a good speed. By the way, I started using this site today only
Update 1: One of my browser addon blocks all the ads on webpage, and hence can’t assure the *ad-free* I announced for Vertor.
Update 2: A little clarification: ‘tolly’ in tollytorrents refer to tollywood which refers to movie industry of Telugu.