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.

HTC One S


AD MOB

Nejlepší Smartphone jaro 2012.
n
Brand HTC
Model (codename) One S
Price - (Cena, včetně DPH) 13000
Display size in Inch (v palcích) 4.3
Display-resolution (rozlišení) 960x540
Dotek-typ multi-touch capacitive
CPU typ MSM8260A
CPU MHz 1500
CPU core 2
L2 cache
ROM 16 GB
RAM 1 GB
GPU Adreno 225
NenaMark2 Benchmark
GPU-GLBenchmark
Battery mAh 1650 mAh, 10.5 hours of talk time and 13.2 days of stand-by time
Foto MPx 8
Autofocus AF
Video HD záznam videa, 1920×1080 (1080p HD) @ 30 frame/s - 3GP, .3G2, MP4, WMV, AVI
Official Android ICS Android 4.0 Ice Cream Sandwich, HTC Sense 4.0 overlay
CyanogenMod support
Dotek-prstů-max
Display-ppi
Display-retina
Network HSPA/WCDMA: • Europe/Asia: 850/900/2100 MHz GSM/GPRS/EDGE: • 850/900/1800/1900 MHz
Connectivity 3.5 mm stereo audio jack Bluetooth with aptX™ enabled (Bluetooth® 4.0) Wi-Fi®: IEEE 802.11b/g/n DLNA® for wirelessly streaming media from the phone to a compatible TV or computer micro-USB 2.0 (5-pin) port with mobile high-definition video link (MHL) for USB or HDMI connection (Special cable required for HDMI connection.)
Pozn.


Pdf file


htc one s smartphone

Video - záznam a kvalita videa HTC One S
**

397LW NO topic_id




AD

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


277

How To Check New Version Of Application Android Code | how-to-check-new-version-of-application-android-code



private int _nVersionCode = 0;	
private boolean _bNewVersion = false;


// onCreate
     	 _nVersionCode   = this.getPackageManager()
     	.getPackageInfo(this.getPackageName(), 0).versionCode;
     	Log.d(String.valueOf(_nVersionCode), "versionCode");

// onStart loadPreferences
 public void loadPreferences() {
			//SharedPreferences settings = getSharedPreferences(F.PREFERENCES_NAME, 0);
			SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this);
		int nOldVersionCode =	settings.getInt("_nVersionCode",  0);// old vesion
		if(_nVersionCode > nOldVersionCode)
			_bNewVersion = true;
	}

// onDestroy savePreferences	
	public void savePreferences() {
			SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this);
			SharedPreferences.Editor editor = settings.edit();
			editor.putInt("_nVersionCode", _nVersionCode); // save current version code
			editor.commit();
	}


243

Cross Button in EditText Android | cross-button-in-edittext-android


Cross Button in EditText Android for deleting clearing text in EditText Example source code:
Example allow delete text in EditText by cross button, or do Button click performance.

main.xml type your package name and class
Put into drawable folder cross and ok image.

       <cz.okhelp.wiktionary.CustomEditText
            android:id="@+id/editTextZadejSlovo"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="2"
            android:ems="10"
            android:hint="TypeAndPressGreen"
            android:singleLine="true"
            android:lines="1"
            android:maxLines="1" 
            android:drawableLeft="@drawable/cross"
            android:drawableRight="@drawable/ok" />
<!--button is invisible 0 height 0 width for performance click on button in EditText-->
        <Button
            android:id="@+id/btnGO"
            android:layout_width="0sp"
            android:layout_height="0sp"
            android:layout_weight="0"
            android:text="GO" />




CustomEditText.java

package cz.okhelp.wiktionary; // your package name

import android.content.Context;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.widget.Button;
import android.widget.EditText;

public class CustomEditText extends EditText
{
  private Drawable dLeft,dRight;
  private Rect lBounds,rBounds;
  private static Button btnOk;

  public CustomEditText(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);
  }
  public CustomEditText(Context context, AttributeSet attrs) {
    super(context, attrs);
  }
  public CustomEditText(Context context) {
    super(context);
  }

  @Override
  public void setCompoundDrawables(Drawable left, Drawable top,
      Drawable right, Drawable bottom)
  {
   if(left !=null) {
    	dLeft = left;
    }
   if(right !=null){
      dRight = right;
    } 
    
    super.setCompoundDrawables(left, top, right, bottom);
  }

	@Override
	public boolean onKeyUp(int keyCode, KeyEvent event) {
		if (keyCode == KeyEvent.KEYCODE_ENTER) {
    	btnOk.requestFocus();
    	btnOk.performClick();

		}
		return super.onKeyUp(keyCode, event);
	}
  
  @Override
  public boolean onTouchEvent(MotionEvent event)
  {
  	final int x = (int)event.getX();
  	final int y = (int)event.getY();

  	if(event.getAction() == MotionEvent.ACTION_UP && dLeft!=null) {
  		lBounds = dLeft.getBounds();
  		
  		int n1 = this.getLeft();
  		int n2 = this.getLeft()+lBounds.width();
  		int n3 = this.getPaddingTop();
  		int n4 = this.getHeight()-this.getPaddingBottom();
  		// leva strana
  		if(    x>=(this.getLeft()) 
  				&& x<=(this.getLeft()+lBounds.width())
  				&& y>=this.getPaddingTop() 
  				&& y<=(this.getHeight()-this.getPaddingBottom()))
  		{
  			this.setText("");
  			event.setAction(MotionEvent.ACTION_CANCEL);//use this to prevent the keyboard from coming up
  		}
  	}
  	if(event.getAction() == MotionEvent.ACTION_UP && dRight!=null)
    {
      rBounds = dRight.getBounds();
      int n1 = this.getRight()-rBounds.width();
      int n2 = this.getRight()-this.getPaddingRight();
      int n3 = this.getPaddingTop();
      int n4 = this.getHeight()-this.getPaddingBottom();
      // prava strana
      if(x>=(this.getRight()-rBounds.width()) && x<=(this.getRight()-this.getPaddingRight())
      		&& y>=this.getPaddingTop() && y<=(this.getHeight()-this.getPaddingBottom()))
      {
      	btnOk.requestFocus();
      	btnOk.performClick();
      	event.setAction(MotionEvent.ACTION_CANCEL);//use this to prevent the keyboard from coming up
      }
    }
    
    return super.onTouchEvent(event);
  }

  @Override
  protected void finalize() throws Throwable
  {
    dRight = null;
    rBounds = null;
    super.finalize();
  }
	public void setBtnOk(Button btnOk) {
		this.btnOk = btnOk;
	}
	public Button getBtnOk() {
		return btnOk;
	}
}  



YourActivity.java

//onCreate
        Button  mBtnGO = (Button)findViewById(R.id.btnGO);
        CustomEditText mEditZadani = (CustomEditText)this.findViewById(R.id.editTextZadejSlovo);
        mEditZadani.setBtnOk(mBtnGO);
        mBtnGO.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
             // do stuff for signInButtonClick
          }
        });


//android.okhelp.cz/wiktionary-aplikace-pro-android/

wiktionary

191

configChanges value of the com.google.ads.AdActivity must include | configchanges-value-of-the-com-google-ads-adactivity-must-include


Errors:
E/Ads(333): The android:configChanges value of the com.google.ads.AdActivity must include screenLayout.
E/Ads(333): The android:configChanges value of the com.google.ads.AdActivity must include uiMode.
E/Ads(333): The android:configChanges value of the com.google.ads.AdActivity must include screenSize.
E/Ads(333): The android:configChanges value of the com.google.ads.AdActivity must include smallestScreenSize.
E/Ads(333): You must have AdActivity declared in AndroidManifest.xml with configChanges.

Solution:
Try to using a lower version of the GoogleAdMobAdsSDK ADS SDK in project:
GoogleAdMobAdsSDK-4.0.4
How add SDK to project

Add activity to AndroidManifest.xml


// .............. blah
    <uses-sdk android:minSdkVersion="4"/>
   <uses-permission android:name="android.permission.INTERNET" />
   <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <application android:icon="@drawable/dicts_ico" android:label="@string/app_name" 
    >
           <meta-data 
        android:value="a12345_your_number" 
        android:name="ADMOB_PUBLISHER_ID" />
        <activity android:name=".MainStartMenu"
                  android:label="@string/app_name"
                  android:configChanges="keyboardHidden|orientation"
                  >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>


  <!-- Google ads -->      
<activity android:name="com.google.ads.AdActivity"
              android:configChanges="keyboard|keyboardHidden|orientation"/>

// ......... blah 
158

Check Internet connection Android example | check-internet-connection-android-example



public boolean isConnected() {
	 try {
		ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
		 return cm.getActiveNetworkInfo().isConnectedOrConnecting();
	} catch (Exception e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
		Log.e("isConnected", e.getMessage());
		Toast.makeText(getApplicationContext(), e.getMessage(),
				Toast.LENGTH_LONG).show();
		return false;
	}


3

Download file from URL | download-file-from-url


Download image file from URL to ImageView Java Android source example code.



Context context = thisClass.this;
Drawable image = ImageOperations(context,
"//www.okhelp.cz/images/android/ad_4.png"
,"image.jpg");
ImageView imgView;
imgView = (ImageView)findViewById(R.id.idImageView);
imgView.setImageDrawable(image);

	private Drawable ImageOperations(Context ctx, String url, String saveFilename) {
		try {
			InputStream is = (InputStream) this.fetch(url);
			Drawable d = Drawable.createFromStream(is, "src");
			return d;
		} catch (MalformedURLException e) {
			e.printStackTrace();
			return null;
		} catch (IOException e) {
			e.printStackTrace();
			return null;
		}
	}

	public Object fetch(String address) throws MalformedURLException,IOException {
		URL url = new URL(address);
		Object content = url.getContent();
		return content;
	}


Editace: 5.7.2020 - 10:55
Počet článků v kategorii: 397
Url:htc-one-s-nejlepsi-smartphone

AD
11 Share
Share
Tweet