Tag: android

Difference between isExternalStorageRemovable and isExternalStorageEmulated

Environment.isExternalStorageRemovable() was added in API 9 And Environment.isExternalStorageEmulated() was added in API 11 isExternalStorageRemovable returns true when getExternalStorageDirectory‘s path is removable or not, more like a SD Card and if it return false, its internal storage and can never be removed physically. And isExternalStorageEmulated is just do opposite of isExternalStorageRemovable ? Now, my question is […]

How can I use android support libraries v4 and v13 in the same project?

I’m trying to use both v4 and v13 support libraries and the ADT is giving me the error: Found both android-support-v4 and android-support-v13 in the dependency list. Because v13 includes v4, using only v13. I need to use both because I have to use: import android.support.v4.app.ActionBarDrawerToggle; import android.support.v4.widget.DrawerLayout; import android.support.v13.app.FragmentPagerAdapter; I’ve tried to add the […]

How do I gracefully handle an Android service being killed by OS?

I have a service which is required to run for long periods of time in the background. A foreground service is not suitable due to the notification. It needs to run quietly in the background doing it’s polling. It does this already and behaves as it should. This is not my problem, this is just […]

Padding doesn't work on some devices

I had a strange problems during the set padding to EditText. xml looks like this: <EditText android:layout_width=”270dp” android:layout_height=”55dp” android:ems=”10″ android:id=”@+id/etEmail” android:textStyle=”bold” android:layout_gravity=”center_vertical” android:textColor=”#FFFFFF” android:hint=”Or Use your Email” android:inputType=”textEmailAddress” android:layout_alignLeft=”@+id/textView6″ android:layout_alignStart=”@+id/textView6″ android:textColorHint=”#FFFFFF” android:background=”@drawable/line_white” android:paddingLeft=”16.5dp” android:layout_marginTop=”10dp” android:paddingRight=”2dp” /> Here is the screenshot from Samsung Note 2 (Android 5.0.1): … and LG G3 (Android 4.4.2): As you can […]

How to avoid adding of inject method for each view?

Currently to get instance of for example Picasso in an activity, I need to add inject method to AppComponent. How to avoid adding of the inject method, because I have a lot of fragments and views where it should be injected: AppComponent.class: @ForApplication @Singleton @Component( modules = {AppModule.class,OkHttpClientModule.class,NetworkApiModule.class,NetworkAuthModule.class}) public interface AppComponent { void inject(Fragment1 obj); […]

Open Android App by sending a text message?

I was wondering if it is possible to open an android app on someones phone by sending them a text message, assuming the user already has the application installed on his/her phone. Sort of like where’s my Droid application? Could I send it like a text message saying “OPEN ” a background service will recognize […]

geting error/warning for plurals : “The quantity 'one' matches more than one specific number…”

Background I work on an app that has many translations inside it. I have the next English plural strings: <plurals name=”something”> <item quantity=”one”>added photo</item> <item quantity=”other”>added %d photos</item> </plurals> and the French translation: <plurals name=”something”> <item quantity=”one”>a ajouté une photo</item> <item quantity=”other”>a ajouté %d photos</item> </plurals> The problem For both the French and Russian, I […]

Android in-app purchase of a subscription with a free trial – how to avoid abuse?

I’ve searched high and low for guidance on how best to address this… I’ve read Google Play In-App Subscriptions (http://developer.android.com/google/play/billing/billing_subscriptions.html) and the section on Implementing Subscriptions (http://developer.android.com/google/play/billing/billing_integrate.html#Subs) but I still don’t see a way to avoid abuse. I’ve also seen the related question here – Google Inapp purchasing and trial period. However, using the SharedPreferences […]

How to hide the BottomNavigationView below keyboard with adjustResize set

According to the material design spec, when the keyboard appears, the BottomNavigationView should hide underneath it. However, if I set android:windowSoftInputMode=”adjustResize” in the Activity’s manifest then the BottomNavigationView moves above the keyboard. I need to set adjustResize to enable scrolling to the bottom of the screen while the keyboard is open. However, I do not […]

Access /data folder files in android

I have rooted my device and I have install busybox. Now I want to access /data folder files through my application. My application have super user permissions but still I am not able to access file . Can any one know how to do this (with or without busybox)? Please help me. Code: if ((new […]

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