Getting telephone country code with Android

I would like to know how can i get the device/user country code from within my android app I know there is a lib named TelephonyManager but i couldn’t find the country code feature To make myself clear: I have an activity which asks the user to enter his phone number and i want the […]

EditText request focus

I am designing a login page as: UserName: ….. Password: ….. LoginButton When the activity starts, I want the focus to go to “UserName” textbox and the keyboard to appear. I am using the following code: boolean checkFocus=user.requestFocus(); Log.i(“CheckFocus”, “”+checkFocus); if(checkFocus==true) { InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); mgr.showSoftInput(user, InputMethodManager.SHOW_IMPLICIT); } I don’t understand where to […]

How to programmatically set drawableRight on Android Edittext?

I know about set drawableRight in XML. but i required to do it programmatically because it is change as per some condition.

Android Camera Intent: how to get full sized photo?

I am using intent to launch camera: Intent cameraIntent = new Intent( android.provider.MediaStore.ACTION_IMAGE_CAPTURE); getParent().startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST); and using: Bitmap thumbnail = (Bitmap) data.getExtras().get(“data”); photoImage.setImageBitmap(thumbnail); photoImage.setVisibility(View.VISIBLE); But it is only a thumbnail, how do I get the full bitmap? I know I can use my own Activity and use: Camera.PictureCallback() But is there anyway to do it […]

Android Fragment (with Compatibility Package on 2.3.3) creates “Specified child already has a parent error”

I’m using fragments in my Android application using the compatibility package. I have tested the application on a Nexus One running 2.3.3 and an Google API 2.2 emulator. When adding the fragment via the layout XML it works great (using a fragment tag). When adding the fragment dynamically into a FrameLayout it does not successfully […]

Android set degree symbol to Textview

This question already has an answer here: Degrees symbol (as in Degrees Celsius/Fahrenheit) in a TextView 4 answers

How can I stop the LogCat output from scrolling automatically in Eclipse?

UPDATE: This turned out to be a bug in R14 of the SDK tools. It has been fixed in R15 which was released on Oct/27/2013. Updating to the latest release solves the problem as suggested in the accepted answer. I use the LogCat window in the Debug view in Eclipse to diagnose and fix crashes […]

APK signing error : Failed to read key from keystore

I’m developing android app under intellij and gradle. and using following way to generate keystore file: keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000 then used the keystore file in build.gradle: signingConfigs { robert { storePassword ‘robert’ storeFile file(‘/Users/bournewang/Documents/Project/android.keystore’) keyPassword ‘robert’ keyAlias ‘mike’ } } when finally trying to generate […]

Where to store Android preference keys?

When I create preference activity I define all preferences in xml file. Every preference has a key defined in this xml. But when I access preference I write: SharedPreferences appPreferences = PreferenceManager.getDefaultSharedPreferences(this); boolean foo_value = appPreferences.getBoolean(“foo_key_defined_in_xml”, false); Is there any way to avoid referencing “foo_key_defined_in_xml” in hard-coded way? Maybe there is a possibility to reference […]

Live stream RTMP/RTSP player without using webview (WOWZA server) on Android

I am developing an Android application in which I want to publish as well as stream a video… What I want is: My app records a video and that video is sent to the server The recorded video will be streamed live to another Android device at the same time.. I have completed the first […]

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