Marko Gargenta

author
+ Follow
since Mar 27, 2011
Marko likes ...
Android Java
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Marko Gargenta

Regarding Android Security, I suggest you check out this presentation from my brother: http://marakana.com/forums/android/general/530.html
It was highly rated.
Marko
12 years ago
You cannot update UI thread from a non-UI thread. That's why you are getting that problem. Take a look at AsyncTask - it was designed specifically to get around this problem. It simply synchronizes threads over UI components.

I used to use Handler to post delayed messages and have something repeat over and over again that way. It works, but it's not as elegant as AlarmService.

I addressed all these issues in the book. Hopefully it helps you.
Marko
12 years ago
Well if you are writing code that depends on android.* code, you must run it on an Android device. That is because android.* classes depend on rest of the stack on the system. And to run it, it should be an Android application. So, one option is to create an application that is driving your library on the device. Other option is not to use android.* code and make your library work off of standard SQLite classes in witch case you can test outside Android.
12 years ago
I see. Hmm, so you have Java code that imports android.* and you want to test it but using JUnit.

You could subclass TestCase from regular JUnit package:
http://developer.android.com/reference/junit/framework/package-summary.html
and run it that way. You'd still run it within an Android app, so you'd need to have some kind of Activity or something to call your library.

Hope this helps.
12 years ago
Android Unit Testing framework does cover all Android components, so Activities, Services, Broadcast Receivers, and Content Providers. See: http://d.android.com/reference/android/test/package-summary.html for more details.

For other Java classes, keep in mind that Android JUnit is built on top of regular JUnit, so you can use regular framework for testing.
12 years ago
I agree with those concerns. For example, for point-to-point communication, an app developer would just use SSL, like on any other platform. For lost/stolen device, Android provides Device Management capabilities which are part of the operating system.

So, from those two points of view, platform takes care of this (just like any other operating system) and an app developer does not need to worry about those particulars.
12 years ago
The book assumes you know Java or similar language. Then it teaches you how to develop reasonably complex applications for Android platform.
12 years ago
Yes, the LocationManager takes time interval just as a hint. If you want more precise timing, I'd look into manually requesting updates when needed (plus that helps save battery). You can use AlarmService to set the intervals.
12 years ago
Security is such a wire concept. No, I do not particularly focus on securing the platform. This book is mostly for writing Android apps.
12 years ago
Actually, Android's Java is based on JavaSE (Standard Edition) and has nothing to do with JavaME (aka J2ME). So, knowing Java programming is important but knowing how JavaME works is not at all.
12 years ago
So, emulator has its own IP:

setprop net.eth0.dns1 10.0.2.3
setprop net.gprs.local-ip 10.0.2.15

But keep in mind that emulator is basically a virtual machine inside of your host computer. So, as such, it's sharing your hosts tcp stack.

I hope this helps.
12 years ago
The book is mostly version-agnostic. I wrote most of the code on FroYo and Gingerbread. The book does not cover Honeycomb as the API for it wasn't available until recently.
12 years ago
I'd say you should be familiar with Java or similar language.
12 years ago
I think the big difference is that this book is the result of delivering Android Bootcamp training class to 1000+ developers. As such, I saw what works when it comes to learning Android. So, the coverage is probably similar to other books, but methodology is probably different.
12 years ago
Sounds like ADT didn't install properly. Try restarting your Eclipse, or re-installing ADT.
12 years ago