PDA

View Full Version : Android Issues/Quirks



mbalsam
6 Oct 2011, 2:17 AM
The goal of this thread is to collect issues or quirks people are experiencing running their apps on Android devices and hopefully find solutions for those issues that can be resolved. I am aware that there are already a couple of Android related threads but none of them tries to collect all known issues/quirks as well as possible solutions or workarounds.

I have developed an app that has only been tested on iOS (iPhone 3GS, iPad1, iPhone4) until today. Now here's a list of issues and quirks I have found on the first run of the app on Android (Galaxy SII Android 2.3.3):

Rendering


rounded corners don't look as smooth as on iOS (especially buttons seem a bit fuzzy)
round items (e.g. slider knobs, carousel indicators) look hideous
some corners of field sets are rendered round some sharp (seems to be random)
on a scrollable panel, icon masks are shown as mere blocks when scrolling*
animations/transitions don't feel as smooth as on iOS. During an animation everything looks a bit fuzzy/distorted (especially images).
I have a floating scrollable panel whih is shown by a button when the button is tapped. Whenever I scoll inside the floating panel the anchor isn't shown properly*
Interaction


pinch events are not fired / captured
I will probably find more things while testing the app and I will update this thread whenever I stumble upon something noteworthy. As a first impression I can say that my Sencha Touch app performs pretty ok on Android but doesn't look and feel as pretty and smooth as on iOS. In my opinion the statement that a Sencha app is hard to distinguish from a native one only holds true for iOS.

Feel free to share your Android related findings!

*As the .anchor CSS class also uses the -webkit-mask style I assume that something is broken with using this style on scrolling panels on Android

mbalsam
6 Oct 2011, 8:17 AM
I thought about a solution for the pinch behaviour (let me add the information that I am using PhoneGap and thus a WebView) and had an idea that might actually work. In your Activity you could do the following:



public class MyActivity extends DroidGap {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.loadUrl("file:///android_asset/www/index.html");
}


@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
if (ev.getPointerCount() == 2) {
float x0 = ev.getX(0);
float y0 = ev.getY(0);
float x1 = ev.getX(1);
float y1 = ev.getY(1);
super.appView.loadUrl("javascript: [fire touch event with the two touches here]");
return false;
}
return super.dispatchTouchEvent(ev);
}
}


The only problem that is left is that you don't know what element is the target of this event but at least it lets you detect a multitouch gesture on the JavaScript side...