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.

Android button text alignment left right - sample


AD MOB

android:gravity="left|center_vertical" or android:gravity="right|center_vertical"
               
<Button
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:gravity="left|center_vertical"
                    android:paddingLeft="20dp"
                    android:text="My Button"
                     />


397LW NO topic_id




AD

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


83

Hashtable key value pair add put get pair Java Android example | hashtable-key-value-pair-add-put-get-pair-java-android-example


How add pair of strings to Hashtable, how get pair key value from Hashtable, how split string, basic Java Android example.

MainClass.java

import java.util.Enumeration;
import java.util.Hashtable;
public class MainClass {
	public static void main(String[] arg) {
		
		// english;germany dictionary
		String[] arrayOfString = { "one;eine", "two;zwei", "three;drei" };

	    Hashtable<String, String> hashTable = new Hashtable<String, String>();
	    for(String s: arrayOfString){
	    	String[] array = s.split(";");
	    	String sKey ="", sValue="";
	    	if(array.length > 1){
	    	sKey = array[0]; sValue = array[1];
	    		hashTable.put(sKey, sValue);
	    	}
	    }

	    Enumeration<String> enumer = hashTable.keys();
	    while (enumer.hasMoreElements()) {
	      String keyFromTable = (String) enumer.nextElement();
	      // get Returns the value to which the specified key is mapped, 
	      // or null if this map contains no mapping for the key
	      System.out.println(keyFromTable + " = " + hashTable.get(keyFromTable));
	    }       

	    
	}
}
/*
two = zwei
one = eine
three = drei
 */
322

View overrides onTouchEvent but not performClick | view-overrides-ontouchevent-but-not-performclick



public class Panel extends SurfaceView implements SurfaceHolder.Callback {
//............... code
//............... some code
   /**
     * Process the MotionEvent.
     */
    @Override
    public boolean onTouchEvent(MotionEvent event) {
    	
        synchronized (getHolder()) {
            if (event.getAction() == MotionEvent.ACTION_DOWN) {
            	performClick();
             } else if (event.getAction() == MotionEvent.ACTION_MOVE) {
            	if(_currentGraphic==null)return true;
                
            } else if (event.getAction() == MotionEvent.ACTION_UP) {
            }
            return true;
        }
    }
/////////////////////////////
 @Override
 public boolean performClick() {
  // Calls the super implementation, which generates an AccessibilityEvent
        // and calls the onClick() listener on the view, if any
        super.performClick();

        // Handle the action for the custom click here

        return true;
 }

}

395

Download file from root Android device Windows | download-file-from-root-android-device-windows


Download file from Android device using Android Studio

stackoverflow.com/questions/34603355/android-device-monitor-data-folder-is-empty

C:\Users\user>c:\Users\user\AppData\Local\Android\sdk\platform-tools\adb shell (press Enter)
shell@Kraft-A6000:/ $ 
shell@Kraft-A6000:/ $ su (Enter)
root@Kraft-A6000:/ #
root@Kraft-A6000:/ # su -c "chmod 777 /data" (Enter)
root@Kraft-A6000:/ # su -c "chmod 777 /data/data" (Enter)
root@Kraft-A6000:/ # su -c "chmod 777 /data/data/com.your_package" (Enter)
root@Kraft-A6000:/ # su -c "chmod 777 /data/data/com.your_package/databases" (Enter)
root@Kraft-A6000:/ # su -c "chmod 777 /data/data/com.your_package/databases/database_name.db" (Enter)


  • Open Android Studio -> Tools -> Android -> Android Device Monitor (meybe some message box, minimalize all windows to find message box - close message box )
  • Pull data from Explorer

Date: 13.07.2020 - 08:23
164

Immutable bitmap passed to Canvas constructor - Android error | immutable-bitmap-passed-to-canvas-constructor-android-error


Try this source code:

Bitmap myBitmap = BitmapFactory.decodeResource(getResources(),R.drawable.my_image)
.copy(Bitmap.Config.ARGB_8888, true);
Canvas c = new Canvas(myBitmap);
// etc.  ....... 


Issue: Immutable bitmap passed to Canvas constructor
Solution: Bitmap myBitmap = BitmapFactory.decodeResource(getResources(),R.drawable.my_image)
.copy(Bitmap.Config.ARGB_8888, true);
200

Samsung i9250 Galaxy Nexus | samsung-i9250-galaxy-nexus






























Brand Samsung
Model (codename) i9250 Galaxy Nexus
Cena, včetně DPH 9000
Veikost Displaye v palcích 4.65
Display-resolution 1280x720
Dotek-typ kapacitní
CPU typ
CPU MHz 1200
CPU core 2
L2 cache
RAM 1 GB
ROM 16 - 32 GB
GPU TI OMAP 4460 1,2 GHz dual-core
NenaMark2 Benchmark
GPU-GLBenchmark
Baterie mAh 1750
Foto MPx 5
Autofocus yes
Video 480p - 30 frames/s
Official Android ICS Android 4.0 Ice Cream Sandwich
CyanogenMod support
Dotek-prstů-max
Display-ppi
Display-retina
Network GSM&EDGE: 850 / 900 / 1.800 / 1.900
Connectivity
Pozn.


samsung-i9250-galaxy-nexus image
samsung-i9250-galaxy-nexus


Editace: 2011-10-30 11:25:20
Počet článků v kategorii: 397
Url:android-button-textalignment

AD
11 Share
Share
Tweet