Update/change cached bitmap using Picasso and OkHttp

I’m currently using Picasso and OkHttp for my bitmap caching. What I want to do is retrieve a specific cached bitmap, draw on it, and then put that drawn on bitmap back into the memory and disk cache. My implementation is pretty standard, I’m just using Target and adding the loaded bitmap to a custom […]

How do I determine audio capabilities on Android?

I’m experimenting with Android’s audio recording and playback. Is there a way to enumerate the available audio parameters on my device? Right now, when I pass a combination of parameters that the hardware (or emulator) doesn’t like, I just get an error. So I am having to “guess”: int bufferSize; int sampleRate; // does the […]

How to deal with width inconsistency between android 4.0-4.3 and 4.4 on Cordova or Phonegap?

I’m doing an application on Cordova 3.4 and testing on the Moto X with Android 4.4.2, Samsung Galaxy Ace with android 2.3 and the emulator. I leave the original viewport created by the cli: <meta name=”viewport” content=”user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi” /> On the css I’m working with relative sizes: html { font-size: […]

Fragment android:visibility in xml layout definition

How does it works? I have layout like below: <LinearLayout android:layout_width=”match_parent” android:layout_height=”match_parent” android:orientation=”vertical” > <fragment android:id=”@+id/search_form_fragment” android:name=”FragmentClass” android:layout_width=”match_parent” android:layout_height=”match_parent” /> <fragment android:id=”@+id/result_list_fragment” android:name=”FragmentClass” android:layout_width=”match_parent” android:layout_height=”match_parent” android:visibility=”gone” /> </LinearLayout> Note the second fragment has android:visibility=”gone” and indeed it is not visible on screen. But this code: boolean bothVisible = firstFrag.isVisible() && secondFrag.isVisible(); returns true, which was […]

AsyncHttpRequest POST not triggering callbacks (android-async-http by loopj)

I’m trying to send a POST to a server using loopj‘s async http library. The following code is pretty standard but I can’t get it to work. I have debugged quite a bit and have checked the following: The URL is correct. The params are correct and they are stored correctly into the params variable. […]

How to check root access in android?

I created a method for checking whether the android phone is rooted or not. This is done as follows public int checkrootcommand(String string) { // TODO Auto-generated method stub Process exec; try { exec = Runtime.getRuntime().exec(new String[]{“su”,”-c”}); final OutputStreamWriter out = new OutputStreamWriter(exec.getOutputStream()); out.write(“exit”); out.flush(); Log.i(SUPER_USER_COMMAND, “su command executed successfully”); return 0; // returns zero […]

Gradle take too much to build

I’m use Android studio , and when i build a project , it’s give me from Grandle console : Executing tasks: [:app:assembleDebug]’ , and it’s get stuck on it , and give me no progress !

How to add a calendar event on an Android device with a given date?

From Stack Overflow question How to add calendar events in Android? I came to know how to add the calendar event, but with the specific time for starttime (with hour and minutes) and EndTime (with hour and minutes). How can we add?

How to set ANDROID_NDK_HOME so that Android Studio does not ask for ndk location?

My ndk is located at C:\Users\X\AppData\Local\Android\ndk. Now each time I create a new native android project and try to import into Android Studio, it asks me for the location of ndk. I can manually set the ndk in local.properties also. But I am looking for a way to set this ndk path, so that Android […]

Do Android Phones have a MAC address when connected to 3G?

I was wondering if Android phones have a MAC address when connected to the internet over 3G? I’m assuming they do, so I guess my real question is whether or not there is anyway of accessing it? I haven’t found anything from looking through the APIs or by googling, but maybe I missed something. Thanks […]

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