Tag: android

Android Build Tools only builds x86_64 no matter what. APK runs installed via adb, but shows incompatible on Play Store

So this is happening. No matter what I try doing on the build.gradle, all APK are coming out with native_code = ‘x86_64’ flag, so when I deploy the app to the store the result is having +15K uncompatible devices, and only 19 compatible. I first thought that, somehow, having NDK installed was the reason, or […]

Recyclerview onBindViewHolder called for all items when inside LinearLayout with weights

I recently updated from support library recyclerview-v7:23.1.1 to recyclerview-v7:25.1.0. My Layout contains 2 recylerviews splitted 50% on the screen. The xml code is as follows: <LinearLayout android:layout_width=”match_parent” android:layout_height=”match_parent” android:orientation=”horizontal”> <android.support.v7.widget.RecyclerView android:id=”@+id/recyclerView1″ android:layout_width=”0dp” android:layout_height=”match_parent” android:layout_weight=”1″ android:scrollbars=”none”/> <android.support.v4.widget.Space android:layout_width=”@dimen/two_dp” android:layout_height=”match_parent” android:background=”@color/dark_gray”/> <android.support.v7.widget.RecyclerView android:id=”@+id/recyclerView2″ android:layout_width=”0dp” android:layout_height=”match_parent” android:layout_weight=”1″ android:scrollbars=”none”/> </LinearLayout> Now onBindViewHolder is called for all list items instead […]

Does Android TTS support Speech Synthesis Markup Language?

Passing the following SSML (Speech Synthesis Markup Language) document to the com.svox.pico TextToSpeech engine resulted in a reading of the XML body but no control from the phoneme element or the emphasis element. This result (no apparent SSML control) is the same on a Nexus One running Android 2.2 as well as on the emulator […]

Is it possible to enable the “Show layout bounds” developer option programmatically?

For example, I can manipulate ADB debugging using: Settings.Secure.putInt(getActivity().getContentResolver(),Settings.Secure.ADB_ENABLED, 1); Is it possible to enable the “Show layout bounds” option in a similar manner? I haven’t been able to find any documentation on it.

Google Cloud Messaging register fails

PROBLEM SOLVED UPDATE: I solved this Problem. The problem is in method registerGCMInBackground(). GoogleCloudMessaging.getInstance() expects the ApplicationContext. private void registerGCMInBackground(final String userId) { new AsyncTask<Void, Void, String>() { @Override protected String doInBackground(Void… params) { String msg = “”; Log.d(“Register GCM”, “started”); try { if (gcm == null) { //PROBLEM SOLVED HERE gcm = GoogleCloudMessaging.getInstance(getApplicationContext()); Log.d(“GCM”, […]

Hide keyboard when down arrow is pressed

The picture shows a part of my app, an AutoCompleteTextView with an attached adapter. When the user enters something into that view, autocomplete suggestions are shown. The problem I have is: when the suggestions are shown and the device’s down arrow is pressed, only the suggestions from the AutoCompleteTextView are closed, the keyboard stays open […]

How can I load a class from a jar file packaged in my .apk file?

I am trying to load a plugin implementation of an interface from a jar file which is in the /assets directory of my .apk file. The only way I’ve been able to get this to work is by extracting the jar file to private external storage and then passing that file to the DexClassLoader. That […]

measuring text on scaled canvas

I’ve been struggling with text measuring and scaled canvases. When the canvas is unscaled, getTextBounds and measureText deliver accurate results. However, when the canvas is scaled both methods do not deliver results that match the actual size of a printed text. For testing I’ve created a subclass of View with the following onDraw method: final […]

how to use addPreferencesFromResource for android 2.X?

Followed several howto but I can’t understand, how to use addPreferencesFromResource(R.xml.preferences) because is deprecated. The best way is to use the fragment but fragments are available only later 3.0, I need to do for android version 2.x Which way I’ll follow?

Is there an Android Spotify developers API?

I was looking into building an android app that utilizes the Spotify API but when i looked on this page it doesn’t list an android API? is there one out there somewhere? if not are there any other streaming music services that have API’s for android? http://developer.spotify.com/en/libspotify/overview/

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