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.

phpbb forum mobile friendly theme style


AD MOB

- download any mobile styles for example //www.artodia.com/phpbb-styles/mobile/
- unzip style into your forum style folder for example all art_mobile folder copy into 0:/myweb/forum/styles/
- folow instalation istructions //www.artodia.com/phpbb-styles/mobile/tutorials/mobile-detection/
- check url result on https://www.google.com/webmasters/tools/mobile-friendly

397LW NO topic_id




AD

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


144

Compressing a bitmap to JPG format Android example | compressing-a-bitmap-to-jpg-format-android-example


Codec, compress(), CompressFormat, quality, decodeByteArray(), Android example source code with image.

public class MainActivity extends Activity {
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(new SampleView(this));
	}

	private static Bitmap codec(Bitmap src, Bitmap.CompressFormat format,
			int quality) {
		ByteArrayOutputStream os = new ByteArrayOutputStream();
		src.compress(format, quality, os);

		byte[] array = os.toByteArray();
		return BitmapFactory.decodeByteArray(array, 0, array.length);
	}

	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.GRAY);
            
                        //  you need to insert some image flower_blue into res/drawable folder
			Bitmap b = BitmapFactory.decodeResource(getResources(), R.drawable.flower_blue);
                        // Best of quality is 80 and more, 3 is very low quality of image 
			Bitmap bJPGcompress = codec(b, Bitmap.CompressFormat.JPEG, 3);
                   // get dimension of bitmap getHeight()  getWidth()
		   int h = b.getHeight();
           
           canvas.drawBitmap(b, 10,10, paint);
           canvas.drawBitmap(bJPGcompress, 10,10 + h + 10, paint);
           
		}

	}
}



jpg compression android
192

Samsung Galaxy Pocket - Android | samsung-galaxy-pocket-android


Nejmenší telefon od Samsungu s Androidem se někdy přidává i jako dárek k zakoupenému zboží, přesto tento telefon toho za svou cenu něco přes 2 000 korun umí hodně.
Technické parametry Samsung Galaxy Pocket
Rozměry a hmotnost: 103,70 × 57,50 × 12 mm, 97 g
Sítě GSM 850 / 900 / 1800 / 1900 MHz, W-CDMA (3G) 900 MHz / 2 100 MHz
Displej TFT TN, 2,80" (320 × 240 px), dotykový: kapacitní
Procesor 832 MHz
Paměť RAM 256 MB, vnitřní paměť 3 GB, paměťové karty microSD
Operační systém Android 2.3, údajně nelze upgradovat
Hudba: mp3, aac, wav, wma
Video: mp4, 3gp, 320 × 240 px, 15 FPS
Fotoaparát 2 Mpx
Navigace vestavěná GPS, elektronický kompas
Baterie 1 200 mAh, pohotovostní doba: 312 hodin
Cena něco přes 2 000 korun / léto 2012

samsung-galaxy-pocket
4

Read file from URL | read-file-from-url


Read file from URL to array of byte and convert to UTF-8 String Android examle source code.

URL urlLoc = new URL("//myweb.com/myfile.html");
URLConnection conexion = urlLoc.openConnection();
conexion.setConnectTimeout(4000);
conexion.setReadTimeout(1000);
conexion.connect();

// downlod the file
InputStream input = new BufferedInputStream(urlLoc
		.openStream());

StringBuffer responseBuffer = new StringBuffer();
byte[] byteArray = new byte[1024];
while (input.read(byteArray) != -1)
 {   
        String res = new String(byteArray, "UTF-8");
        responseBuffer.append(res);
        byteArray = null;
        byteArray = new byte[1024];
 }

String response = responseBuffer.toString().trim();



283

Get Set Screen Orientation Android Code | get-set-screen-orientation-android-code



// in AndroidManifest.xml
<Activity
 android:screenOrientation="portrait" // or landscape

// in MyActivity.java
boolean mbOrientacionLandscape = false;
int nOrientation =	getResources().getConfiguration().orientation;
if(mbOrientacionLandscape==true){
	 getResources().getConfiguration();
	if(nOrientation != Configuration.ORIENTATION_LANDSCAPE)
	setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
	
}
else{
	if(nOrientation != Configuration.ORIENTATION_PORTRAIT)
	setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}

134

Draw Oval Android basic example | draw-oval-android-basic-example


drawOval(), setStrokeWidth(), setStyle()


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) {

			canvas.drawColor(Color.CYAN);
			Paint p = new Paint();
			// smooths
			p.setAntiAlias(true);
			p.setColor(Color.RED);
			p.setStyle(Paint.Style.STROKE); 
			p.setStrokeWidth(4.5f);
			// opacity
			//p.setAlpha(0x80); //
 
			canvas.drawOval(new RectF(50, 50, 20, 40), p);;
		}

	}
}


Editace: 2015-05-10 10:08:57
Počet článků v kategorii: 397
Url:phpbb-forum-mobile-friendly-theme-style

AD
11 Share
Share
Tweet