Wednesday, May 8, 2013

Android App

Java has always been somehow unlucky for me, even though I have a lot of experience with similar languages, like C# and JavaScript. I tried it and failed several times over last five, six years. I was able to make the Hello World to work, but nothing beyond. This applies for Android as well, I remember installing the SDK two or three times in the past. Maybe because I used NetBeans and then Eclipse. But this time I tried IntelliJ IDEA (community edition) from JetBrains.

The first steps were obvious: File > New Project... > Android Application Module, fill the project form and create the project, package "com.qetrix". My test device is old Android 2.2, so I selected this one and API 8. But what now? I knew something about Activities but I had no idea what it's all about. I read somewhere it's like a Controller in MVC. OK, but what about view (something like Form in .NET)?

I tried to add new GUI Form, but it was dead end. I tried tutorial from JetBrains and I learned the GUI is defined as XML file in res/layout/ directory. I created new XML and - voila! Nice. I started adding controls and for me it was quite understable.

I created the screen with a list of databases (ListView with ArrayAdapter) and compiled it. After a while it launched an emulator and after it booter and I unlocked the screen, the app appeared. Fantastic! :)

Then I created new form as Login, set it as startup and launched the other from this one, using ".startActivity(myIntent);". This was a pivotal moment for me, from this point on it was just a matter of time, manuals and best practices.

Login screen (Czech locale). Oldschool - I know :)

The development for Android is really fun after all :)

3 comments:

  1. I was very pleased to find this site.I wanted to thank you for this great read!! I definitely enjoying every little bit of it and I have you bookmarked to check out new stuff you post. GBWhatsAPP Anti Ban APK

    ReplyDelete
  2. Amazingly charming article, I acknowledged examining your post, especially tolerable offer, I have to joke this to my followers. Much valued!. Fred @ LeReviewist

    ReplyDelete
  3. Hmm great site.very nice.visit this site that is the best one for watching movies,dramas etc..visit uptodown

    ReplyDelete