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.

Samsung Galaxy S


Samsung Galaxy S nejlepší cena od 4 500 KCZ Kč (únor.2012)
Samsung Galaxy S je chytrý telefon s operačním systémem Android.
Samsung Galaxy S je (22.února2012) 5. a 6. nejpoužívanějším chytrým telefonem u programu Sky Map viz tabulka.


Samsung Galaxy S byl představen firmou Samsung v březnu 2010. Je vybaven 1 GHz ARM "Hummingbird - kolibřík" procesorem, 8-16 GB interní flash pamětí, 4-palcovým 480 × 800 pixelů Super AMOLED kapacitním dotykovým displejem, Wi-Fi připojením, 5-megapixelovým fotoaparátem s maximálním rozlišením 2560x1920 a u vybraných modelů předním čelním 0,3 MP fotoaparátem VGA (640x480).

Samsung Galaxy S photo pic image
samsung galaxy s2
Zdroj obrázku: wikipedia

397LW NO topic_id



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


135

Draw Arc Android basic example | draw-arc-android-basic-example


drawArc(), Canvas, Paint, 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(5);
			// opacity
			//p.setAlpha(0x80); //
 
			RectF rectF = new RectF(50, 20, 100, 80);
			canvas.drawOval(rectF, p);
			p.setColor(Color.BLACK);
			canvas.drawArc (rectF, 90, 45, true, p);
		}

	}
}

218

Java pass variable as reference | java-pass-variable-as-reference


Integer, Float, String, List passed as reference in JAVA example source code:

// List passed as reference JAVA
List<Integer>list = new ArrayList<Integer>();

public void fc (List<Integer>listRef){
listRef.add(7);
listRef.add(5);
}
fc(list); // 7, 5 


// String passed as reference JAVA
	public void mutate(AtomicReference<Object> ref) { ref.set("Goodbye"); }

		AtomicReference<Object> ref = new AtomicReference<Object>("Hello");
		mutate(ref);
		System.out.println(ref.get()); //Goodbye!
             String s = (String) ref.get();


// Integer passed as reference JAVA
	private static void mutate(AtomicReference<Object> ref) { ref.set(7); }

	//public static void main(String[] arg) {
		AtomicReference<Object> ref = new AtomicReference<Object>(5);
		mutate(ref);
		System.out.println(ref.get()); // 7
int n = (Integer) ref.get();


// Float passed as reference JAVA
	private static void mutate(AtomicReference<Object> ref) { ref.set(14.8f); }

	//public static void main(String[] arg) {
		AtomicReference<Object> ref = new AtomicReference<Object>(12.1f);
		mutate(ref);
		float f = (Float) ref.get();
		System.out.println(f); //14.8

384

Convert Activity to Fragment Step by Step | convert-activity-to-fragment-step-by-step


public class Main extends Activity {

private TextView mTextView;
private Activity mAct;
private Intent mIntent;

protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main_layout);
  mTextView = findViewById(R.id.mTextView);
  mAct = getActivity();
  mIntent = getIntent();
 }

}


to:
public class Main extends Fragment{

 private TextView mTextView;
 private FragmentActivity mFrgAct;
 private Intent mIntent;
 private LinearLayout mLinearLayout;
 public View onCreateView(LayoutInflater inflater, ViewGroup container,
          Bundle savedInstanceState) {
          View root = inflater.inflate(R.layout.fragment_main, null);
        return root;
    }

 public void onViewCreated(View view, Bundle savedInstanceState) {
          // you can add listener of elements here
          /*Button mButton = (Button) view.findViewById(R.id.button);
            mButton.setOnClickListener(this); */
          mTextView = view.findViewById(R.id.mTextView);
          mLinearLayout = (LinearLayout)view;
 }
 public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
          mFrgAct = getActivity();
          mIntent = mFrgAct.getIntent(); //  Intent intent = new Intent(getActivity().getIntent());
 }

}



325

Eclipse update failed folder in use | eclipse-update-failed-folder-in-use


Failed to rename directory ....
If using for update Android SDK manager,
try close Eclipse if is open.
Or change security settings of the folder which have problem.
Or disable antivirus for a moment.
79

ArrayList Collections Add new Item Sort Find Item Java example | arraylist-collection-sort-add-java-example


How add item to ArrayList, sort ArrayList, search find index of item in ArrayList, min(), max() Java basic example.

import java.util.ArrayList;
import java.util.Collections;

public class MainClass {
	public static void main(String[] arg) {
		String[] arrayOfString = {"nothing", "Hello", "people"
				, "bye-bye", "hello", "world!", "End" };
		   ArrayList<String> arrayList = new ArrayList<String>();
            for(String s: arrayOfString)
		     arrayList.add(s);

		    Collections.sort(arrayList);
		    // foreach
		    for (String str: arrayList)
		      System.out.println(str);
		    
		    Object objMin = Collections.min(arrayList);
		    System.out.println("Min is: " + objMin);
		    
		    Object objMax = Collections.max(arrayList);
		    System.out.println("Max is: " + objMax);
		    
		    int index = Collections.binarySearch(arrayList, "people");
		    System.out.println("Index of people is: " + index);
		    
		  }

		
	
}
/*
End
Hello
bye-bye
hello
nothing
people
world!
Min is: End
Max is: world!
Index of people is: 5
*/


Editace: 2012-02-22 11:25:55
Počet článků v kategorii: 397
Url:samsung-galaxy-s
Share
Share
Tweet