Solutions, Tutorial

Make Genymotion point to localhost

I had a lot of fights with this and I think it’s better to write down the solution so I won’t waste my time looking again on google/stackoverflow for it. Maybe this will help you too! Problem You might have a local webservice or something on your machine that needs to be accessed from a […]

, , , , ,
Tutorial

Android Floating Action Button (FAB) Tutorial

TUTORIAL DEPRECATED Use this tutorial instead: Floating Action Button New In this tutorial I will show you how to add a Floating Action Button aka FAB, for pre Lollipop versions and for Lollipop. For pre versions it will be just a simple round button with shadow and click effect, but for Android 5.0 we will use

, , , ,
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”>

, ,
Tutorial

Android Lollipop Navigation Drawer Animation Support

In Android 5.0 (Lollipop) the Navigation Drawer has a very nice animation, the drawer icon changes into a back arrow when the slider is opened and changes back to default icon when the slider is closed. So far so good, if you develop an app for devices running only Android 5.0. But what if you

, ,
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 }

, , ,
Snippets, Solutions, Tutorial

Add CardView to Android OS versions below L ()

You might notice the new CardView widget on Android L preview presentation. The view can be used to display text or images and has a nice shadow. You can add that view into your project even if you don’t have the minimum API level to “L”… to do that, follow the steps below: 1.  Edit your gradle.build

, , , ,
Tutorial

Android: RecyclerView Tutorial

Hi,  in today’s tutorial I will show you how to create a list with the newest widget presented at Google I/O 2014, RecyclerView. Also I will show how to add click and long click events within adapter. WHAT’S DIFFERENT? is a more advanced and flexible version of ListView it forces the implementation of ViewHolder pattern

, , ,
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

, , ,
Scroll to Top