2014

Snippets, Solutions, Tutorial

Add links to a TextView in Android

Maybe you need to add links to a TextView on Android but you don’t want to use Linkify for some reasons and you also want that link to be opened when the user taps it. Here is a simple solution: yourTextView.setText(Html.fromHtml( “Text with a ” + “<a href=\”http://www.myandroidsolutions.com/\”>link to My Android Solutions</a> “)); // this is […]

, , , ,
Solutions

Android ShareActionProvider Change Text Color

I think I spent 2 days in order to find a way of changing the text color of the ShareActionProvider. There are some posts on the internet but none worked for me. So I started to try myself each and every item attribute from @style/Theme.AppCompat.Light.DarkActionBar. After a while I found the items I was looking for: <item name=”textAppearanceLargePopupMenu”>

, ,
Snippets, Solutions

Android: How To Change Hint’s Size

If you need to set a smaller hint for your edit text, you can set the hint this way: myEditText.setHint(Html.fromHtml( “<small><small><small>” + getString(R.string.hint) + “</small></small></small>”)); Also, you can set the size in the string resource file where is the string for the hint. <string name=”edit_text_hint”><font size=”15″>My hint string</font></string> and in the xml file just set

, , ,
Snippets

Get Android OS Version

If you ever need to get the version of the OS on which your app runs, you can try this out: android.os.Build.VERSION.SDK_INT And you can use it against(for more check this out): android.os.Build.VERSION_CODES.[BASE-KITKAT]   Finally you end up with something like: if(android.os.Build.VERSION.SDK_INT == android.os.Build.VERSION_CODES.HONEYCOMB){ // do whatever you want here }

, , ,
Solutions, Tutorial

ListView Empty Message

When I first needed to set a message on a ListView that was empty, I tried different methods, but none of them worked, except the one that I will describe in this tutorial. So let’s start. When you want to show a message to the user when the ListView is empty, you have to keep

Snippets, Solutions

Errors after update to Android Studio 0.8

I have just updated my Android Studio to Android Studio 0.8.2. But, after the update I kept getting these 3 errors while I was trying to run my project: 1.  First error Error:Execution failed for task > java.io.FileNotFoundException: C:\Program Files (x86)\Android\android-studio\sdk\tools\proguard\proguard-android-optimize.txt (The system cannot find the path specified) 2. Second error (this happened only after the

, ,
Snippets, Solutions

Share image Intent

Whenever you need to share an image from the external storage you can use the startActivity method and an Intent to do that. Doing so, the user will be able to chose whatever app he likes to share the photo. Intent share = new Intent(Intent.ACTION_SEND); share.setType(“image/png”); share.putExtra(Intent.EXTRA_STREAM, Uri.parse(“file:///”+imagePath)); startActivity(Intent.createChooser(share, “Share Image”)); If you don’t append the

, , ,
Tutorial

Android Add AdMob With Google Play Services

You might want to also check AdMob with Firebase Tutorial Now we can integrate ads from AdMob using Google Play Services. There are some changes in the way ads must be implemented now, so this why I decided to make a tutorial about it and to explain how we have to add ads to our projects. So let’s

Info

Android Emulator Alternatives: Genymotion

In Android emulators are very slow. It takes a lot of time to boot, to develop, to test. I am pretty sure everyone searched at least once for ways of improving their emulator’s speed, or for alternatives. I did. And not once, but many times. And now I discovered Genymotion. I must say that it’s

Tutorial

Android Google Maps Api v2

I finally decided to make a new post about the latest way of integrating Google Maps in Android applications. Please note that Google Maps Api v1 is now deprecated and supported by Google any more, so this is deprecated too. So you have to do some preliminary steps first. What tools did I use? Android

sponsored
Exit mobile version