Is it possible to get the phone's currently selected profile?

The stock Cyanogenmod ROM has support for profiles baked in and although I’m not sure if this is a part of the default Android functionality, I was wondering if it is possible to get the name of the currently selected profile. I haven’t been able to find any developer documentation on this. (Assuming that the […]

Android: only show cursor in edittext when keyboard is displayed

how can I only show the cursor of an EditText when the keyboard is displayed. At the moment the cursor is blinking even if the EditText is not active and the keyboard is hidden, which is really annoying. This is how my layout looks: <?xml version=”1.0″ encoding=”utf-8″?> <RelativeLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:id=”@+id/activity_main_root” android:layout_width=”match_parent” android:layout_height=”match_parent” android:background=”@color/white” > <ImageButton […]

How to detect a click on a polyline

If there is a polyline on googlemap and a click is performed on the map, then how can I check whether that click was on polyline or somewhere else? Polyline line = googleMap.addPolyline(new PolylineOptions() .add(new LatLng(51.2, 0.1), new LatLng(51.7, 0.3)) .width(5) .color(Color.RED)); googleMap.setOnMapLongClickListener(new OnMapLongClickListener() { } });

Freehand Image Crop draw inside bitmap region

Trying to achieve freehand cropping of an image, so I’m able to draw on the image. But it goes outside bitmap region. I just wanna restrict that user can only draw inside bitmap region, check below screen shot. I am trying to implement functionality like Photoshop lasso tool. Its drawing outside view region, which generates […]

In Android, how do you select only PHONE contacts?

I am querying the Contacts out of the built in Contacts provider URI in Android. I want to get just the PHONE contacts; is there any consistent way to do this? It seems from what I can find that the account name for phone contacts differs from manufacturer to manufacturer (see this question). Is there […]

DialogFragment size (width) ignored

I’m using a DialogFragment and found the width always becomes always fullscreen when I make an inner LinearLayout’s layout_width=match_parent, no matter how many contraints I try to force on it by fixing the layout_width and minWidth of the parent view, or setting the Layout dimens in CreateView() dialog.xml <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”@dimen/dialog_width” android:layout_height=”@dimen/dialog_height” […]

What are “Android SDK Tools”, “Android SDK Platform Tools” and “Android SDK Build tools”?

This question already has an answer here: What are the Android SDK build-tools, platform-tools and tools? And which version should be used? 6 answers

Switch keyboard profile programmatically

Is there any way that we can switch installed keyboards programmatically (without going to the settings section manually)? My requirement is that the user is presented with all the keyboards which are installed on the phone and gets a chooser dialog to switch to the one wishes? (basically we want to cut down the step […]

How can I get latency info from Android's AudioTrack class?

I’ve noticed that the C++ classes underlying the AudioTrack and AudioRecord APIs in Android both have a latency() method that is not exposed via JNI. As far as I can see, the latency() method in AudioRecord still does not take into account the hardware latency (they have a TODO comment for that), but the latency() […]

Feature Custom Title: Cannot combine custom titles on API 11 and above

I have a project in which i setted: minSdkversion setted to 10 MainActivity is a TabActivity Code in onCreate method is this: super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); setContentView(R.layout.main); getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.custom_title); … With previous settings, all works well! But, if i set minSdkVersion to 11 or above, this exception occurs: android.util.AndroidRuntimeException: You cannot combine custom titles with other title […]

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