Tag: android-layout

How to display the indicator bubble on top of the imageview?

I have a string value (i.e.: numbers 1, 2, 3, …) and I should display those on the top right corner of my ImageView. How can I do that in android? I have attached an image below in which I show arrows: I want something like that to display over my ImageView? Please anyone can […]

How to add stereo,treble options in audio equalizer?

I am trying to a small audio songs equalizer. I want to add in it options of treble,stereo like it is in Poweramp player. I implemented equlizer with 5 bands successfully like this:- public class FragmentEqualizer extends Fragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) { super.onCreateView(inflater,container,savedInstanceState); equalizer = new EQ(getActivity(), new Equalizer(0,com.androidhive.musicplayer.AndroidBuildingMusicPlayerActivity.mp.getAudioSessionId())); […]

How to create Android applications for all resolutions?

Hi, I am a beginner in Android development. I want to create an Application which can be run on different screen resolutions. This App should then run on Android phones as well as Android tablets. Is it possible? If so, how should I handle the UI design? Just set up different drawable folders?

Class cast exception in FrameLayout when am trying to change the order of views in layout xml?

Here is my layout file <FrameLayout android:layout_width=”match_parent” android:layout_height=”0dp” android:layout_weight=”3″> <WebView android:id=”@+id/document_id” android:layout_width=”match_parent” android:layout_height=”match_parent”/> <ProgressBar android:id=”@+id/load_document_progress” android:layout_width=”30dp” android:layout_gravity=”center” android:layout_height=”30dp” android:visibility=”invisible”/> <Button android:id=”@+id/start_btn” android:layout_width=”90dp” android:layout_height=”30dp” android:text=”@string/start_btn_txt” android:textStyle=”bold” android:textColor=”#000000″ android:layout_gravity=”center” android:visibility=”invisible” android:onClick=”updatePresentationId” android:background=”@drawable/border_radius”/> </FrameLayout> This is working. But when I have to change the order of the elements. I will get ClassCastException. Here is my my logcat trace. […]

Mapview and Fragment

I’ve seen some topics some months ago, about the fact that using (Google)MapView inside a Fragment was a bit tricky/impossible. I would like to know if atm (June) there is a workaround ? My application (Android 3.0) is essentially working with the Fragment system and I need to display a map in one of these […]

How can I Calculate screen height and width at run time?

I have following class in android, where I am defining some functions to calculate motion of Bubbles on the screen. public class floatBubble { private Bitmap img; // the image of the ball private int coordX = 512; // the x coordinate at the canvas private int coordY = 600; // the y coordinate at […]

Progress dialogue has white background on Lollipop Devices ,

I am migrating my application on Android 5.0 i.e. Lollipop devices , I have problem regarding progress dialog , It work perfectly on pre lollipop devices , but on lollipop it has white background as shown in image But in pre lollipop devices it is of transparent background Below is my code : progress.xml in […]

get position of view with respect to top-most parent in android

To get a view relative to its parent, I can use getLeft(), getRight(), getTop(), and getBottom(). But how do I get a view relative to the top-most parent of the layout file? So say my eve layout is RelativeLayout. Then say inside eve I have a number of nested layouts. And then deep within the […]

ImageView within RelativeLayout has top and bottom padding

I have a 640px wide, 208px tall PNG that I’ve placed in my /drawable folder and I’m having a very hard time properly placing it in an ImageView. I want to scale the image so that it maxes out the horizontal resolution, and I want it to scale vertically only as much as it takes […]

missing ActionBar in material design

I want to develop an Android app with AndroidStudio and the new material design and it looks great on Android 5.0 but when I test the app on my 4.4.2 phone, the ActionBar of the app is missing. Here is my Manifest: <application android:allowBackup=”true” android:icon=”@drawable/ic_launcher” android:label=”@string/app_name” android:theme=”@style/MyTheme” > <activity android:name=”.MainActivity” android:label=”@string/app_name” > <intent-filter> <action android:name=”android.intent.action.MAIN” […]

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