Android java.lang.VerifyError?

In my Android app, I always get VerifyErrors! And I cannot figure out why. Whenever I include a external JAR, I always get VerifyErrors when I try to launch my app (except for once, when I included Apache Log4j.) I usually get around this by taking the source of the library and adding it to […]

How to install trusted CA certificate on Android device?

I have created my own CA certificate and now I want to install it on my Android Froyo device (HTC Desire Z), so that the device trusts my certificate. Android stores CA certificates in its Java keystore in /system/etc/security/cacerts.bks. I copied the file to my computer, added my certificate using portecle 1.5 and pushed it […]

Android Studio: Module won't show up in “Edit Configuration”

I’ve imported a project to Android Studio with several subprojects. I want to run a subproject. I successfully make’d this subprojects build.gradle as a module. In order to run it, I went to Run > edit configurations > + > Android Application. Problem: When I try to select a module, none show up in the […]

proguard hell – can't find referenced class

So, I’m TRYING to release some software but Proguard is giving me a headache. When I try to export using proguard I’m getting lots of warning ie “can’t find referenced class” For example: [2011-08-07 17:44:37 – GAME] Warning: org.simpleframework.xml.stream.StreamReader: can’t find referenced class javax.xml.stream.events.XMLEvent [2011-08-07 17:44:37 – GAME] Warning: there were 52 unresolved references to […]

How to remove auto focus/keyboard popup of a field when the screen shows up?

I have a screen where the first field is an EditText, and it gains the focus at startup, also popups the numeric input type, which is very annoying How can I make sure that when the activity is started the focus is not gained, and/or the input panel is not raised?

How to return an array from JNI to Java?

I am attempting to use the android NDK. Is there a way to return an array (in my case an int[]) created in JNI to Java? If so, please provide a quick example of the JNI function that would do this. -Thanks

Border in shape xml

I am trying to make a drawable to use for a button. I would like it to have this coloring, with a 2px border around it. Everything works just fine except I cannot get the border to show up… <?xml version=”1.0″ encoding=”utf-8″?> <shape xmlns:android=”http://schemas.android.com/apk/res/android” android:shape=”rectangle” > <gradient android:startColor=”@color/bar_clicked_dark” android:endColor=”@color/bar_clicked_light” android:angle=”90″/> <corners android:bottomLeftRadius=”0dp” android:topLeftRadius=”15dp” android:bottomRightRadius=”15dp” android:topRightRadius=”0dp” […]

DateTime picker in android application

Is there any android widget that enable to pick the date and the time at the same time ? I already use the basic time picker and date picker. But they are not that sexy and user friendly (I found). Do you know if a widget including both date and time exists? Thanks a lot, […]

Android 5.0 – Add header/footer to a RecyclerView

I spent a moment trying to figure out a way to add a header to a RecyclerView, unsuccessfully. This is what I got so far: @Override protected void onCreate(Bundle savedInstanceState) { … layouManager = new LinearLayoutManager(getActivity()); recyclerView.setLayoutManager(layouManager); LayoutInflater inflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); headerPlaceHolder = inflater.inflate(R.layout.view_header_holder_medium, null, false); layouManager.addView(headerPlaceHolder, 0); … } The LayoutManager seems to […]

Start service in Android

I want to call a service when a certain activity starts. So, here’s the Service class: public class UpdaterServiceManager extends Service { private final int UPDATE_INTERVAL = 60 * 1000; private Timer timer = new Timer(); private static final int NOTIFICATION_EX = 1; private NotificationManager notificationManager; public UpdaterServiceManager() {} @Override public IBinder onBind(Intent intent) { […]

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