Android – Preventing WebView reload on Rotate

When I rotate my screen, the WebView reloads the whole page. I can’t have this since some of my content contains dynamic/random material. Currently when rotated the screen reloads the original URL from the loadUrl() method. Any idea what’s wrong with my code? package com.mark.myapp; import; import android.os.Bundle; import android.util.Log; import android.view.KeyEvent; import […]

How to convert an Eclipse Android project to use Ant for build?

I have an Android project in Eclipse I would like to convert to be built with Ant instead. How can I achieve this? I have tried exporting an Ant build file but I’m pretty sure that’s not going to work (nor does it when running ant with the exported file). I do not know much […]

How to detect a mobile device manufacturer and model programmatically in Android?

I want to find device specification of a mobile phone for examples, the device manufacturer, model no ( and may be types of sensors in the device, wifi chipset etc..). I want to get the device manufacture/model number (eg. Samsung GT-I9100 i.e Galaxy S2) programmatically. The manufacture/model number is also used in Google Play when […]

Synchronize(“Cache_Group”) part gets skipped , why is it so?

I am trying to figure out that my synchronize(“Group_Name”) gets skipped if I try to sync different values through it , why is it so . Consider the following issue . I have a SyncGroup named – “Group1” in which I have a MBO named “MBOGroup1” in which I have attributes “name” , “password” , […]

Gradle project refresh failed after Android Studio update

Here’s the output: 11:57:04 AM Gradle ‘KeddreaderProject’ project refresh failed: Cause: org.gradle.internal.service.ServiceLocator.([Ljava/lang/ClassLoader;)V: I’ve tried to remove .gradle folder, but it doesn’t help. What can be the problem? Edit: I get this error even when I try to import any other project on Ubuntu 13.10. But on Windows everything works (with the the same version of […]

Android: Cannot perform this operation because the connection pool has been closed

I was reading through stackoverflow about this question and I still haven’t found a solution. I notice that sometimes, my app throws this error: java.lang.IllegalStateException: Cannot perform this operation because the connection pool has been closed. at android.database.sqlite.SQLiteConnectionPool.throwIfClosedLocked( at android.database.sqlite.SQLiteConnectionPool.waitForConnection( at android.database.sqlite.SQLiteConnectionPool.acquireConnection( at android.database.sqlite.SQLiteSession.acquireConnection( … I have a file called using this approach to […]

Android – Adding at least one Activity with an ACTION-VIEW intent-filter after Updating SDK version 23

I am getting following tool tip in AndroidManifest.xml App is not indexable by Google Search; consider adding at least one Activity with an ACTION-VIEW intent-filler. See issue explanation for more details. Adds deep links to get your app into the Google index, to get installs and traffic to your app from Google Search. Any one […]

Android Resource – Array of Arrays

I am trying to implement a resource data structure that includes an array of arrays, specifically strings. The issue I run into is how to get the sub-array objects and their specific values. Here is what my resource file looks like…. <resources> <array name=”array0″> <item> <string-array name=”array01″> <item name=”id”>1</item> <item name=”title”>item one</item> </string-array> </item> <item> […]

Getting Android owner's email address nicely

I want to allow the user to provide me their email address without typing it in. Ideally, there’d be a text field where the user could either type an email address or push a button to autofill it. In an earlier question, Roman Nurik suggests using an AccountManager to handle this, but that requires my […]

How to set state_selected in ripple drawable

How to specify android:state_selected inside a RippleDrawable I have following xml for ripple drawable but background color doesn’t show up when I set myView.setSelected(true); <?xml version=”1.0″ encoding=”utf-8″?> <ripple xmlns:android=”” android:color=”#DDDDDD” > <item android:id=”@android:id/mask”> <shape> <solid android:color=”@color/black” /> </shape> </item> <item android:state_selected=”true”> <shape> <solid android:color=”#EEEEEE” /> </shape> </item> <item> <color android:color=”#FFFFFF” /> </item> </ripple>

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