Okhelp.cz

Recepty, články, nápady, programování. Dříve dum-zahrada, finance, internet a know-how.okhelp.cz Pro lepší výsledky hledání používejte i diakritiku.

Statistics usability of mobile phones with Android - September 2011



(Our software)

 
1Samsung Galaxy S213.8% (1,232)
2Samsung Galaxy S8.5% (762)
3Samsung Galaxy Tab7.4% (659)
4Samsung Galaxy Mini5.4% (483)
5Samsung Galaxy S4.0% (356)
6HTC Desire HD3.8% (341)
7Samsung Galaxy Ace3.8% (339)
8HTC Wildfire3.2% (286)
9Samsung Galaxy Fit3.1% (274)
10SEMC Xperia X102.1% (190)

397LW NO topic_id



Další témata ....(Topics)


170

webcoreglue(): The real object has been deleted Emulator Error | webcoreglue-the-real-object-has-been-deleted-emulator-error


Error for example:
webcoreglue(2075): The real object has been deleted

Solution:
If this error message shows if orientation the screen is changed
try insert into AndroidManifest.xml this code:
android:configChanges="keyboard|keyboardHidden|orientation"

      <activity
            android:label="@string/app_name"
            android:name=".MyActivity" 
            android:screenOrientation="portrait"
            android:configChanges="keyboard|keyboardHidden|orientation"
            >

150

drawBitmap, clipPath, UNION, DIFFERENCE, INTERSECT, REPLACE, XOR Android example | drawbitmap-clippath-union-difference-intersect-replace-xor-android-example



public class MainActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(new SampleView(this));
	}

	private static class SampleView extends View {

		// CONSTRUCTOR
		public SampleView(Context context) {
			super(context);
			setFocusable(true);

		}

		@Override
		protected void onDraw(Canvas canvas) {
			Paint paint = new Paint();

			canvas.drawColor(Color.YELLOW);

			 Bitmap b = Bitmap.createBitmap(200, 200,
			 Bitmap.Config.ARGB_8888);

			// you need to insert a image flower_blue into res/drawable folder

			paint.setFilterBitmap(true);
			Bitmap bitmapOrg = BitmapFactory.decodeResource(getResources(),
					R.drawable.flower_blue);
			canvas.drawBitmap(bitmapOrg, 10, 10, paint);
			int width, height;

		    Canvas c = new Canvas(b);
		    paint.setAlpha(255); //0x80
		    c.translate(0, 30);
		    c.drawBitmap(bitmapOrg, new Matrix(), paint);
		    paint.setColor(Color.BLUE);
        Path mPath = new Path();
		    mPath.addCircle(50, 50, 50, Path.Direction.CCW);
            //c.clipPath(mPath, Region.Op.UNION);
            //c.clipPath(mPath, Region.Op.DIFFERENCE);
            c.clipPath(mPath, Region.Op.INTERSECT);
            //c.clipPath(mPath, Region.Op.REPLACE);
            //c.clipPath(mPath, Region.Op.XOR);
           paint.setColor(Color.GREEN);
           paint.setAntiAlias(true);
           c.drawCircle(30, 20, 30, paint);

		    int h = bitmapOrg.getHeight();
			//canvas.drawBitmap(bitmapOrg, 10, 10, paint);
			canvas.drawBitmap(b, 0, 10 + h + 10, paint);

		}

	}
}



bitmap xor android


regions
6

Show keyboard | show-keyboard


Show keyboard Android phone apps development example source code.

// ActivityClass.java
InputMethodManager showSoftInput;
Button hBtnKeyboardShow ;
//onCreate
showSoftInput = (InputMethodManager)this.getSystemService(Context.INPUT_METHOD_SERVICE);

hBtnKeyboardShow = (Button)findViewById(R.id.btnKeyboardShow);
hBtnKeyboardShow.setOnClickListener(myButtonListener);
// END onCreate

//button listener
private OnClickListener myButtonListener = new OnClickListener() {
     public void onClick(View v) {
     	 try {
     		 showSoftInput.getInputMethodList();
                 showSoftInput.toggleSoftInput(showSoftInput.SHOW_FORCED, 0);	
		} catch (Exception e) {
			Log.e("Keyboard show ", e.getMessage());
			
		}
     }
};


7

Show keyboard in WebView Android example | webview-keyboard


Show keyboard if WebView input have focus Android apps development example source code.

WebView webview;

//in onCreate

	webview = (WebView) findViewById(R.id.idWebviewPda);
	webview.getSettings().setJavaScriptEnabled(true);
	webview.loadUrl("//android.okhelp.cz");
	
	webview.requestFocus(View.FOCUS_DOWN);
    webview.setOnTouchListener(new View.OnTouchListener() {
        @Override
        public boolean onTouch(View v, MotionEvent event) {
            switch (event.getAction()) {
                case MotionEvent.ACTION_DOWN:
                case MotionEvent.ACTION_UP:
                    if (!v.hasFocus()) {
                        v.requestFocus();
                    }
                    break;
            }
            return false;
        }
    });

57

Change TableRow background color if on row click Android example | change-tablerow-background-color-if-on-row-click-android-example


Change table row background color if user click on row Android example code.
MainActivity.java

public class MainActivity extends Activity {
Boolean bColorYellow = true;
TextView hTextView;
TableRow hTableRow;
@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        hTextView = (TextView)findViewById(R.id.idTextView);
        hTableRow = (TableRow)findViewById(R.id.idTableRow1);


        
        
    } // end onCreate
  
    
    public void myTableRowClickHandler(View view) {
		switch (view.getId()) {
		case R.id.idTableRow1:{
			
			if(bColorYellow){
			hTableRow.setBackgroundColor(Color.GREEN);
			bColorYellow = false;
			}
			else{
			hTableRow.setBackgroundColor(Color.YELLOW);
			bColorYellow = true;
			}
		}
		break;
		}
  }
}


main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="//schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >


<TableLayout android:layout_height="wrap_content" android:layout_width="fill_parent" android:id="@+id/tableLayout1">
    <TableRow android:id="@+id/idTableRow1" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:background="#5655AA"
    android:onClick="@string/myTableRowClick"
    android:focusable="true">
<TextView  
	android:id="@+id/idTextView"
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:text="@string/hello"
    />
    
    </TableRow>
</TableLayout>
    
    
</LinearLayout>



strings.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="hello">Hello World!</string>
    <string name="app_name">TableRow</string>
    <string name="myTableRowClick">myTableRowClickHandler</string>
</resources>








Editace Jana Žákovská : 2011-10-19 08:16:12
Počet článků v kategorii: 397
Url:statistics-usability-of-mobile-phones-with-android-september-2011
Share
Share
Tweet