Android Application vs Activity

I have written a few Android apps, and have always declared a starting Activity as the: <intent-filter> <action android:name=”android.intent.action.MAIN” /> <category android:name=”android.intent.category.LAUNCHER” /> </intent-filter> It would be great for scoping some global methods, statics, shared prefs, etc if I could start my app using an Application that then calls the first Activity from it’s onCreate() […]

Dagger 2 on Android, no error messages

I’m using Dagger 2 in my Android project and I’m having trouble debugging it. I know that the compilation fails because of an error in my dagger 2 setup (had it before) but it’s almost impossible to track it down because I don’t get a proper error message telling me where the problem lies. All […]

How can I make a Java app using the Monkeyrunner API?

The Android SDK has an API for sending commands to the phone called Monkeyrunner. It appears to be a Python API. Is there anyway I can use it in a Java application?

Android: Create ListView in XML?

I want to create a list view with limited set of items that isn’t really going to change. Each row is going to have an image on the left and text on the right. (Just like in the Settings app) Can I populate that in XML (i.e. avoid writing code) ?

android.Settings.Secure.ANDROID_ID

I’m developing an android application and I’m going to use the LVL library to check google play licence. After reading the LVL documentation, I’ve read that I have to obtain the android.Settings.Secure.ANDROID_ID to obfuscate the google play responses. But I’ve also read that the ANDROID_ID obtained from TelephonyManager is sometimes the same for different devices. […]

Android: Use icon as back button without reloading previous activity

I have the following code to enable to home button to act as a back button. The problem I’m facing is from this activity if I use the real back button it simply goes back to the previous activity just as I left it. If I use the home button it’s reloading the page so […]

Picasso loads into wrong imageview when using view holder pattern

I’m trying to use the Picasso library to load external images into rows in a ListView. I have a custom ArrayAdapter as follows: public class RevisedBusinessesAdapter extends ArrayAdapter<HashMap<String, String>> { Context context; int layoutResourceId; ArrayList<HashMap<String, String>> data = null; public RevisedBusinessesAdapter(Context context, int layoutResourceId, ArrayList<HashMap<String, String>> data) { super(context, layoutResourceId, data); this.layoutResourceId = layoutResourceId; this.context […]

GridView and excess space padding

I have a problem with grid view layout on Android. I can’t find solution to eliminate extra space in grid view. I tried a lot of things (numColumns, columnWidth, stretchMode, gravity) and advices (from StackOverflow), but nothing works correctly. I spent almost 8 hours with this problem. Here is a code of grid view: <GridView […]

How to set a specific tab when opening a Sliding Tab Layout activity?

I tried this tutorial and it works great, but now I would like to know if it is possible, when opening the application, to go directly to a specific tab and not the first one (at left) by default ? Ex : I would like the application to open directly on “events” tab : I […]

How to keep an Android app running indefinitely?

I am writing an Android app which must always be running in the background until the user exits it from the app’s menu. But now I notice that in Android after some time my app is stopped by itself without user intervention. Any idea how to make sure my app will always be running in […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.