Tag: android

What is an API token

I’m trying to work out the best way to handle user authentication for my mobile application (iOS & Android) and API (PHP). From what I’ve researched the options are: Basic auth over HTTPS – Check username/password of the user for every request. Sessions – Send a session ID with each request; server maintains state. So […]

Android std and stl support

I am playing with android ndk. I am using Window Vista with cygwin (latest version). I compiled and launched the hello world jni sample on my phone. It is working. The code is (is a .cpp file): #include <string.h> #include <jni.h> extern “C” { JNIEXPORT jstring JNICALL Java_org_android_helloworld_HelloworldActivity_invokeNativeFunction(JNIEnv* env, jobject javaThis); }; jstring Java_org_android_helloworld_HelloworldActivity_invokeNativeFunction(JNIEnv* env, […]

Why does it matter where the Toast is made in Android if the context is the same?

I have a legacy IntentService that attempts to use Toast messages to display error messages.1 I’d like the messages to be displayed, and have added code to get them on the correct thread. The simplest change would be to pass in the constructed Toast object and then display it on the UI thread. However, the […]

iOS: How to achieve behavior like Android's startActivityForResult

I’m an Android developer working on an iOS version of our app. I need to know how to achieve behavior similar to startActivityForResult on Android. I need to show a new view controller, then have control return to the previous view controller when the new view controller is closed. I also need a callback method […]

Android: What's wrong with my fragment transition animation?

I just need plain slide in and slide out animation for Fragment transition, below is my code: slide_in_left.xml: <?xml version=”1.0″ encoding=”utf-8″?> <set xmlns:android=”http://schemas.android.com/apk/res/android” android:shareInterpolator=”true”> <translate android:fromXDelta=”-100%” android:toXDelta=”0%” android:fromYDelta=”0%” android:toYDelta=”0%” android:duration=”700″> </translate> </set> slide_out_right.xml: <?xml version=”1.0″ encoding=”utf-8″?> <set xmlns:android=”http://schemas.android.com/apk/res/android” android:shareInterpolator=”false”> <translate android:fromXDelta=”0%” android:toXDelta=”100%” android:fromYDelta=”0%” android:toYDelta=”0%” android:duration=”700″> </translate> </set> the code I used: SomeFragment frag = SomeFragment.newInstance(foo); […]

Android::Webview removes scrollbar for a DIV

I made a small webpage with a scrollable div. When I load it in a browser, it works fine. But when I load it in a webview inside Android, it doesn’t let me scroll the div. Is there a workaround for this or do I have to use a different design? I am talking about […]

How to create a thread in Android NDK?

Can anyone tell me how to create a thread in Android NDK? I’m porting some C++ code from Win32 to Android, I don’t know what’s the NDK API corresponding to Win32 API AfxBeginThread(). Thanks!

Android private fields naming guidelines are ok?

Here http://source.android.com/source/code-style.html#follow-field-naming-conventions it is stated that : Field Names Non-public, non-static field names start with m. Static field names start with s. Other fields start with a lower case letter. Public static final fields (constants) are ALL_CAPS_WITH_UNDERSCORES. It also states that : The rules below are not guidelines or recommendations, but strict rules. You may […]

Android AppCompat requires API level 11

I have an app that uses the AppCompat support libary for ActionBars. Now I tried to create a new themes.xml file with some style for that purpose. <!– Application theme. –> <style name=”AppTheme” parent=”@style/Theme.AppCompat.Light.DarkActionBar”> <item name=”android:actionBarStyle”>@style/MyActionBar</item> <item name=”actionBarStyle”>@style/MyActionBar</item> </style> So just the same way it is done here: http://developer.android.com/guide/topics/ui/actionbar.html#StyleExample However, Eclipse throws an error here […]

WebView doesn't load my HTML the second time?

I’ve created a small Activity which is capable of loading two different HTML strings in a webview. When I run the Activity it starts by loading the String from the page_1 variable. So far so good. The page shows as expected. I’ve added an onFling listener which should make the activity load the content of […]

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