When an internet connection is present and I click on “check update” in Android Studio, I get “Connection Failed”

I have a valid Internet Connection. I have freshly installed Android Studio from dev.android.com Problem: When I click check for updates, I get a “Connection failed´╝ÜPlease check your network connection and try again”

Java optimizations: (Hotspot/Dalvik) Optimization of final method returning a constant?

Can anyone tell me if either Hotspot or Dalvik is smart enough to inline calls to a final method returning a constant (static final) int value? Ideally the method call would be replaced by the constant. This might either be at class load time or through JIT. This has implications in the design of some […]

is there any way to get display refresh rate programmatically?

As the title, i want to get the refresh rate of android phone then show to user. Is there any way? Updated: what is refresh rate? http://en.m.wikipedia.org/wiki/Refresh_rate

Android detect webview URL change

I have a webview in my android app and would like to detect when de url changes. I want to use this to hide the info button in the top bar when the user is on the info.php page and show it again when he is not on the info.php page. I googled but can’t […]

ActionBar Title dynamically change with fragment

I have 1 Activity with 3 Fragments inside (Home-Login-RestorePass) Initially, HomeFragment shows and the other two are hidden. I want that the ActionBar Title change depending on which Fragment is showing. I’m trying in my Activity with: public void setActionBarTitle(String title){ getSupportActionBar().setTitle(title); } @Override public void onResume() { super.onResume(); // Set title setActionBarTitle(getString(R.string.app_name)); } and […]

Disable menubutton in the android emulator

When developing applications for ICS – the actionbar looks different depending on if there is a physical menubutton present on the device or not. For example if not, a virtual button is displayed in the actionbar. Is it possible to emulate a device without a menubutton by disabling it somehow in the emulator?

Why The altitude is change if it is Evening or Night?

I have this following code : public SensorEventListener sensorEventListener = new SensorEventListener() { @Override public void onSensorChanged(SensorEvent event) { float pressure_value = 0.0f; float height = 0.0f; if (Sensor.TYPE_PRESSURE == event.sensor.getType()) { pressure_value = event.values[0]; height = SensorManager.getAltitude(SensorManager.PRESSURE_STANDARD_ATMOSPHERE, pressure_value); } value = String.valueOf(height); } @Override public void onAccuracyChanged(Sensor sensor, int accuracy) { } }; I’ve […]

What is RoboSpice Library in android

I am Trying to understand RoboSpice Library in android I saw the online Documentation here What i tried:: I have previously studying on using Spring Library,also Retrofit, AsyncHttp etc I understood that all above convert JSON response to POJO What i need more information:: When i see the documentation on Robospice it looks like a […]

Duplicate Files copied in APK META-INF when Gradle building

I’ve been looking around at some of the answers posted here about this error but have had no luck. I’m hoping to get some clarification about what’s going on. my error is as follows: Error:Execution failed for task ‘:app:transformResourcesWithMergeJavaResForDebug’. com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/maven/commons-io/commons-io/pom.xml File1: /home/colin/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-io/1.3.2/b6dde38349ba9bb5e6ea6320531eae969985dae5/commons-io-1.3.2.jar File2: /home/colin/.gradle/caches/modules-2/files-2.1/commons-io/commons-io/1.3.2/b6dde38349ba9bb5e6ea6320531eae969985dae5/commons-io-1.3.2.jar I’ve done packagingOptions { […]

Android proguard Javascript Interface problem

My project after obfuscation with proguard fail with javascriptinterface Here is the link with some suggestions for proguard configuration but it dosn’t work in my case http://groups.google.com/group/android-developers/browse_thread/thread/f889e846fbf7ec3f?pli=1 So the calls from Javascript loose binding to the associated Java methods My proguard configuration regarding that -keep public class com.trans_code.android.JavascriptCallback -keep public class * implements com.trans_code.android.JavascriptCallback -keepclassmembers […]

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