Android appcompat v7 error

Being new to Android developent I followed the simplest of tutorials, built a new android project, accepting all default settings (built it for kitkat). To my dismay I have an un-planned project – appcompat_v7, along with the errors: The container ‘Android Dependencies’ references non existing library ‘C:\Users…\workspace\appcompat_v7\bin\appcompat_v7.jar’ and twice the following The project cannot be […]

Why doesn't Android appear in Eclipses' preferences?

I’ve installed the Android Developer tools as per the official instructions. Why doesn’t the tab appear in Windows->Preferences, as they said it should?

Android layout placeholder for dynamically added view

In my Android Activity, I need to add a single View dynamically (at runtime), at a specific position in a layout. The view to be added is determined at runtime. For example, may layout may look something like this: <LinearLayout …> <TextView … /> <!– Dynamic item to be added here –> <TextView … /> […]

MediaPlayer setDataSource failed with status=0x80000000 for Ringtone set by filepath on 2.3.4

Title says most of it. My application has been playing ringtones pointed by uri like content://media/internal/audio/media/387 or content://media/external/audio/media/1655 (for custom ringtones on SDcard I believe) using both setDataSource(fileInfo) and setDataSource(mContext, Uri.parse(fileInfo)). In each case I have received logs with information about setDataSource failed.: status=0x80000000 exception on phones using Android 4.x (different versions). Seeing that the […]

How I can multiline the expanded title of CollapsingToolbarLayout?

My problem is the next. I would use relatively large texts as CollapsingToolbarLayout title so I need to show it as multiline mode. When I try to change text appearance through the setExpandedTitleTextAppearance() method it doesn’t work. The code who I used is the next: <style name=”ToolbarExpandedTitle”> <item name=”android:textSize”>48sp</item> <item name=”android:shadowColor”>#ffffff</item> <item name=”android:textColor”>@android:color/white</item> <item name=”android:singleLine”>false</item> […]

Camera preview UI overlay on Android?

How do I write code which layouts UI elements (Buttons, etc) over camera preview on Android ?

How to Play audio through speaker even when headset is plugged in?

The title of the question might look repeated, but my problem is a sometimes problem and causes glitches. I have used the below code to play through speaker when headset is plugged in. AudioManager audioManager = (AudioManager)mContext.getSystemService(Context.AUDIO_SERVICE); audioManager.setMode(AudioManager.STREAM_MUSIC); audioManager.setSpeakerphoneOn(true); if(! Globals.mediaPlayer.isPlaying()){ Globals.mediaPlayer.start(); } The above code plays audio in the following ways: 1. Very few […]

How to disable the navigation bar slide animation when going fullscreen?

I have an activity that goes to another full screen activity. However, when transitioning from this activity to my full screen activity, the navigation bar slides down instead of disappearing instantly. I’ve inflated a full-screen window in the second activity, but because of the slow sliding animation, it resizes 1 second later after the animation […]

How to align/format code in Android Studio?

Is there a way/shortcut/built-in feature that can align code for operands like ‘=’ signs. For example, there is a XAlign for Xcode (https://github.com/qfish/XAlign), allowing user to select code that needs to be aligned and use shortcut to align it automatically. There is a Fields Group feature in Android Studio which can “Align in columns” but […]

Where does application data file actually stored on android device?

I have developed an Android app using Appcelerator Titanium. This app will create a file in applicationDataDirectory and install a database as well. If run on emulator, I can locate those files using “adb” command. But how about on Android device? Can I use the “My Files” app to view those file I created? (since […]

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