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.

Get all ID from xml file for Android developers utility

This software allow find all IDs from xml layout file source code and create variables with findViewById for onCreate, for onClick and load save preferences functions.
Get all ID is for Windows XP and higher.

2017,04,28
Download 1.0.2.0

[caption id="attachment_903" align="alignleft" width="300" caption="Get all ID from xml file for Android developers utility."]android/get-all-id-from-xml-file-android-300x246.png[/caption]

396LW NO topic_id




AD

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


315

Ad baner without GoogleAdMobAdsSdkAndroid-6.4.1 Android example | ad-baner-without-googleadmobadssdkandroid-6-4-1-android-example


First: AdView is in XML file

<com.google.android.gms.ads.AdView
    xmlns:ads="//schemas.android.com/apk/res-auto"
    android:id="@+id/adView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    ads:adUnitId="MY_AD_UNIT_ID"
    ads:adSize="BANNER"/>

// onResume
AdView adView = (AdView)this.findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder()
    .addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
    .addTestDevice("TEST_DEVICE_ID")
    .build();
adView.loadAd(adRequest);




Second: Using AdView in Fragment with LinearLayout
Resolve error in ADT Graphical layout editor:
The following classes could not be instantiated:
- com.google.android.gms.ads.AdView

// layout in xml file
    <LinearLayout
        android:id="@+id/layout"
              android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

// java class with fragment in Fragment class or in Activity class
private static AdView adView;
        @Override
		public void onResume(){  
                super.onResume();
                 try {
                	 // in xml is empty layout
					adView = new AdView(getActivity());
					adView.setAdUnitId("ca-app-pub-626/638103xxxxxxx");
					adView.setAdSize(AdSize.BANNER);  
					
                	                LinearLayout layout = (LinearLayout)getView() .findViewById(R.id.layout);
					layout.addView(adView);
					
					AdRequest adRequest = new AdRequest.Builder().build();   
					adView.loadAd(adRequest);

				} catch (Exception e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
        }


More about:
https://developers.google.com/mobile-ads-sdk/docs/admob/android/play-migration?hl=it
239

AsyncTask Example Android with ProgressBar | asynctask-example-android-with-progressbar


MainActivity.java

package com.asynctaskexample;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;

import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;

import android.os.AsyncTask;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.ProgressBar;
import android.widget.TextView;

public class MainActivity extends Activity {
	private TextView textView;
	private ProgressBar progressBar;
	private DownloadWebPageTask mTask = null;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		textView = (TextView) findViewById(R.id.TextView01);
		downloadPage();
	}

	// AsyncTask <TypeOfVarArgParams , ProgressValue , ResultValue> .
	private class DownloadWebPageTask extends AsyncTask<String, Integer, String> {

		@Override
		protected void onPreExecute() {
			//textView.setText("Hello !!!");
			progressBar = (ProgressBar) findViewById(R.id.progressBar1);
			progressBar.setVisibility(View.VISIBLE);
			super.onPreExecute();
		}

		@Override
		protected void onProgressUpdate(Integer... values) {
			super.onProgressUpdate(values);

		}

		@Override
		protected String doInBackground(String... urls) {
			String response = "";
			for (String url : urls) {
				DefaultHttpClient client = new DefaultHttpClient();
				HttpGet httpGet = new HttpGet(url);
				try {
					HttpResponse execute = client.execute(httpGet);
					InputStream content = execute.getEntity().getContent();

					BufferedReader buffer = new BufferedReader(new InputStreamReader(
							content));
					String s = "";
					while ((s = buffer.readLine()) != null) {
						response += s;
					}

				} catch (Exception e) {
					e.printStackTrace();
				}
			}
			return response;
		}

		@Override
		protected void onPostExecute(String result) {
			progressBar.setVisibility(View.INVISIBLE);
			textView.setText(result);
		}
	}

	private void downloadPage() {
		if (mTask != null
				&& mTask.getStatus() != DownloadWebPageTask.Status.FINISHED) {
			mTask.cancel(true);
		}
               // execute(String[]) you can put array of links to web pages, or array of Integer[] 
               // if first param is Integer[] etc.
		mTask = (DownloadWebPageTask) new DownloadWebPageTask()
				.execute(new String[] { "//android.okhelp.cz/android-market.html",
						"//android.okhelp.cz/android-market.html" });
	}

	@Override
	protected void onDestroy() {
		super.onDestroy();

		if (mTask != null
				&& mTask.getStatus() != DownloadWebPageTask.Status.FINISHED) {
			mTask.cancel(true);
			mTask = null;
		}
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_main, menu);
		return true;
	}

}




activity_main.xml

<LinearLayout xmlns:android="//schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <ProgressBar
        android:id="@+id/progressBar1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

    <TextView
        android:id="@+id/TextView01"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/hello_world" />

</LinearLayout>



AndroidManifest.xml do not forget INTERNET uses-permission !!!!!!!

<uses-permission android:name="android.permission.INTERNET" />

201

Samsung Galaxy Mini (S5570) | samsung-galaxy-mini-s5570






























Brand Samsung
Model (codename) Galaxy Mini (S5570)
Price (cena, včetně DPH) 3500 / 06.2012
Display size in Inch (v palcích) 3.14
Display-resolution 240x320
Dotek-typ kapacitní
CPU typ MSM7227
CPU MHz 600
CPU core
L2 cache yes
RAM 256
ROM 512
GPU Adreno 200
NenaMark2 Benchmark
GPU-GLBenchmark
Baterie mAh 1200
Foto MPx 3
Autofocus no
Video QVGA (320 x 240) při 15 frames/s
Official Android ICS Android Froyo 2.2
CyanogenMod support yes
Dotek-prstů-max Dual-touch (two fingers)
Display-ppi 127
Display-retina 39%
Networks GSM&EDGE (850 / 900 / 1.800 / 1.900 MHz) 3G (900 / 2.100 MHz)
Connectivity Bluetooth V2.1 , USB V2.0 , USB mass storage , SyncML(DM) , WIFI , AGPS, 3.5 mm jack
Note


Samsung S5570 Galaxy Mini - image
android/samsung-s5570-galaxy-mini.jpg
269

How to Add Home Screen Widgets on Your Android Phone | how-to-add-home-screen-widgets-on-your-android-phone


Long press by finger on screen
From dialogue select Widgets
Select your widget
Put your widget on the screen

Video tutorial - to add home screen widgets - Android 2.1