Android Emulator: Failed to allocate memory: 8 even with 8MB RAM

I’m trying to start an emulator, but I keep getting the error Failed to allocate memory: 8. There are some solutions to this problem, setting the RAM from 1024 to 512, but when I even set it to 8 it still crashes with this error! What should I do? Screenshot of the settings: Here the […]

Android: How to set the absolute size of an Activity's Window?

Is there a way to set a GUI screen (Activity) to be 200dip wide and 150dip high, either using XML or programmatically? I found getWindow().setLayout(), but that only take predefined constants for width and height.

OnItemClickListener of spinner

I am able to get Spinner in action bar this way; array of items in re/values/languages.xml <string-array name=”languages”> <item>Finnish</item> <item>French</item> <item>German</item> <item>Slovakian</item> <item>Polish</item> </string-array> In res/menu/main.xml <item android:id=”@+id/menuSort” android:actionLayout=”@layout/spinner” android:showAsAction=”ifRoom” android:title=”@string/choose”/> In res/layout/spinner.xml <Spinner android:id=”@+id/spinner” android:layout_width=”150dp” android:layout_height=”wrap_content” android:entries=”@array/languages”/> And finally activity class; public class Base_Activity extends Activity { @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.main, […]

Android: Volley HTTP Request custom header

I’m getting the following error when I run the app: BasicNetwork.performRequest: Unexpected response code 401 I need to pass an email, a password and a token to access the URL, but it’s not working I started learn android last week, I don’t know much package quest.testvolley; import com.android.volley.AuthFailureError; import com.android.volley.VolleyLog; import com.kpbird.volleytest.R; import android.app.ProgressDialog; import […]

segmented controls type in Android app

I try to make buttons like those on the desk of android: This button are similar to the uisegmentedcontrol for Iphone. I don’t find a easy way to do this in Android. For the moment, I use the Button explain here: http://blog.bookworm.at/2010/10/segmented-controls-in-android.html But the result seems not so good compared to the desk button. There […]

What padding,margin & size should I use for a MenuItem custom layout?

I am currently using a custom layout for my MenuItem: The code is basic: <?xml version=”1.0″ encoding=”utf-8″?> <menu xmlns:android=”http://schemas.android.com/apk/res/android” > <item android:id=”@+id/menu_custom” android:actionLayout=”@layout/menu_layout” android:showAsAction=”always”/> </menu> While the icon size in pixel is described in the Android Design and Guidelines, I have no idea at the margin, padding, width and height I should use for this […]

“compatibility-v4-r4.jar” is missing in Maven Repo

In the last two days I tried to import this Library through Maven: https://github.com/JakeWharton/Android-ViewPagerIndicator I have to say that I’m new to maven so if this is easy to solve please forgive me I googled the problem and studied the error pages but I could not find a solution for this problem. But everytime I […]

Spinner graphical bug API 21

I have one spinner in a fragment that have a very annoying graphical glitch. This occurs only on my Nexus 5 with API 21. I have try to set spinner.setLayerType(View.LAYER_TYPE_SOFTWARE, null) but the glitch is still present. Any ideas?

Android Dropbox SDK manifest setup

Any ideas why I get this error when I call getSession().startAuthentication() for the Android Dropbox SDK? : FATAL EXCEPTION: main : java.lang.IllegalStateException: URI scheme in your app’s manifest is not set up correctly. You should have a com.dropbox.client2.android.AuthActivity with the scheme: db-CHANGE_ME Yet my AndroidManifest.xml has the following within the <Application></Application> as instructed in the […]

Android: How to get friends birth dates from facebook calendar using Graph API

I’m working on application which need birth dates of all friends. Can some body share code how to get birth dates of all friends using graph API. I’m using following code: // start Facebook Login Session.openActiveSession(this, true, new Session.StatusCallback() { // callback when session changes state @Override public void call(Session session, SessionState state, Exception exception) […]

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