Detect my app's own android:versionCode at run time

Is there a way for my app to know the android:versionCode from AndroidManifest.xml or do I have to create a separate constant in one of my classes?

How to get text on an ActionBar Icon?

I want something like this: The 3rd icon is for notifications and it is just a png image now. Is it possible to do something, so that i can change the text/number ie.., 03 programatically to show the actual no.of notifications. Thank You

java.lang.Object cannot be resolved in Eclipse

When I installed the latest installment in Mac OSX – the Mountain Lion – I experienced some problems getting Eclipse to work I also lost most of my Android developer files (but I still have my projects). I suspect this is due to the choice of removing the /Developer and move the XCode and other […]

Jodatime start of day and end of day

I want to create an interval between the beginning of the week, and the end of the current week. I have the following code, borrowed from this answer: private LocalDateTime calcNextSunday(LocalDateTime d) { if (d.getDayOfWeek() > DateTimeConstants.SUNDAY) { d = d.plusWeeks(1); } return d.withDayOfWeek(DateTimeConstants.SUNDAY); } private LocalDateTime calcPreviousMonday(LocalDateTime d) { if (d.getDayOfWeek() < DateTimeConstants.MONDAY) { […]

Multiple pages at the same time on a ViewPager

Is there a possibility to display two pages at the same time, when using a ViewPager? I’m not looking for an edge effect, but rather for two full pages at the same time. Thanks in advance.

how to remove a task from ScheduledExecutorService?

I have a ScheduledExecutorService that times a few different task periodically with .scheduleAtFixedRate(Runnable, INIT_DELAY, ACTION_DELAY, TimeUnit.SECONDS); I also have a different Runnable that I’m using with this scheduler. the problem starts when I want to remove one of the tasks from the scheduler. is there a way to do this? am I doing the right […]

IDE “Cannot Resolve @style/Theme.Appcompat” when using v7 compatibility support theme

This is not really a huge issue, as my project still builds and runs correctly (using gradle), but I’m having trouble getting Android Studio to recognize the application compatibility theme released in the API 18 SDK (for allowing actionbar support for android 2.1 and above). I have the support libraries loading successfully, because code completion […]

JavaScript caret position

I’m developing a mobile banking application and I’m interested in formatting the currency amount inputs in real time. I’ve already tested autoNumeric plugin and jQuery Format Currency Plugin but both have cursor position issues on Android 2.* browsers. Does anyone have a JavaScript solution compatible with this browsers?

WebView textarea doesn't pop up the keyboard

When I display a WebView, I don’t see the soft keyboard popping up. The hard keyboard also doesn’t work! What are the usual shortcomings. The code which I use to access the WebView is: package com.example.blahblah; import; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.os.Handler; import android.preference.PreferenceManager; import android.util.Log; import android.view.KeyEvent; import android.view.Window; import […]

Best place to close database connection

I was looking for a while for answer on my question but I didn`t get what I need. I have an application with a ListView, and form where I can add new record to DB. So there is not much queries to do. How to handle connections to db ? Should I close it after […]

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