Tag Archives: example

6,891 views

sqlite database get path Android

Context context = getApplicationContext(); String DB_PATH = "/data/data/" + context.getPackageName() + "/databases/";

Posted in Android Examples Code, SQLite database | Tagged , | Comments Off on sqlite database get path Android
7,731 views

SurfaceView implements Runnable Android Code

package cz.okhelp.surfview;   import android.os.Bundle; import android.app.Activity; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.view.Menu; import android.view.MotionEvent; import android.view.SurfaceHolder; import android.view.SurfaceView; import android.view.View; import android.view.View.OnTouchListener;   public class MainActivity extends Activity implements OnTouchListener { OurView v; Bitmap ball, … Continue reading

Posted in Android Examples Code, Bitmap, drawing | Tagged , | Comments Off on SurfaceView implements Runnable Android Code
2,942 views

Android code basic rules for developers

read write file from to assets, sdcard,, internal directory, read bytes array, open save file to sdcard or internal directory, get file path, write bytes array, dir reading, dir create, for while calculation, read input , write output Download project … Continue reading

Posted in Android Examples Code | Tagged , , , , , | Comments Off on Android code basic rules for developers
2,429 views

Java Basic Rules

// file name MyFirstClass.java   import java.util.*; import java.lang.Math; import java.io.*; import javax.swing.*;   public class MyFirstClass{ // start of program public static void main(String[] args) { // basic function main   // variables and calculation int a=2; int b=3; … Continue reading

Posted in Android Examples Code, Array,List,Collections | Tagged , , | Comments Off on Java Basic Rules
3,066 views

Android Widget OnClick Example

Open link in browser after user do click on widget area: private Context _context; @Override public void onStart(Intent intent, int startId) { _context = this; String definePage ="http://old.chmi.cz/meteo/rad/rad_data.php"; Intent defineIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(definePage)); PendingIntent pendingIntent = PendingIntent.getActivity(_context, 0 /* … Continue reading

Posted in Android Examples Code | Tagged , | Comments Off on Android Widget OnClick Example
3,852 views

Change icon set Android developers example

How to quickly change all icon set in .apk project with Eclipse: Right click on project in folder tree Select New – Ohter In open wizard dialog select Android Icon Set Set Icon set name: Open some large icon for … Continue reading

Posted in Android Examples Code, Eclipse | Tagged , , | Comments Off on Change icon set Android developers example
4,405 views

String Array of Array Java Example

Set, get string , array of array of strings, Java example code public final static String[][]_arArOfString_1 = { new String[] {"bla","bla","hello world!"}, new String[] {}, new String[] {}, new String[] {}, new String[] {}, new String[] {} }; String sOut … Continue reading

Posted in Android Examples Code, Array,List,Collections | Tagged , , | Comments Off on String Array of Array Java Example
5,231 views

Font Family change on View dynamically Android Example

TypeFace, setTypeface, font, font family, array of String, Button create dynamically @Override protected void onStart() { LinearLayout.LayoutParams p = new LinearLayout.LayoutParams( 48, 55 ); Typeface typeFace = Typeface.MONOSPACE; String [] ar = {"A","B","C","D","E","F","G","H","J","K"}; for (int i = 0; i < … Continue reading

Posted in Android Examples Code | Tagged , , , | Comments Off on Font Family change on View dynamically Android Example
15,906 views

Iterate over each Entry in Map Java Android

entry put iterate Map HashMap Java Android Map<String, Integer> map = new HashMap<String, Integer>(); map.put("key27", 27); for (Map.Entry<String, Integer> entry : map.entrySet()) { String str = entry.getKey(); int n = entry.getValue(); }

Posted in Android Examples Code | Tagged , | Comments Off on Iterate over each Entry in Map Java Android
4,881 views

SeekBar listener Android Example Source

SeekBar setOnSeekBarChangeListener Example. Change TextView font size by SeekBar Example. TextView mTextView01 = (TextView)findViewById(R.id.textView01);   SeekBar mSeekBarTexSize = (SeekBar)findViewById(R.id.seekBarTextSize); mSeekBarTexSize.setMax(100); mSeekBarTexSize.setProgress(25);   mSeekBarTexSize.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { mTextView01.setTextSize((float)progress); }   public void onStartTrackingTouch(SeekBar … Continue reading

Posted in Android Examples Code | Tagged , , | Comments Off on SeekBar listener Android Example Source