Skip to main content

Posts

Showing posts from January, 2013

Android - Zoom Image Using Intent

create Activity add this code : package com.zoomimage; import java.io.File; import android.app.Activity; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.ImageView; import android.widget.Toast; public class ZoomimageActivity extends Activity { private ImageView imagev; private Uri uri_img; private Button btnZ; private String mimetype; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); imagev = (ImageView) findViewById(R.id.imageView1); // imagev.setImageUri(Uri.fromFile(new File("/sdcard/test.jpg"))); // imagev.setImageUri(Uri.parse(ne...

Android - Better alternative of expandable listview

This is alternate solution of Expandable ListView Android.  Your Main Activity Class: package com.example.my_demo; import java.util.ArrayList; import android.app.Activity; import android.os.Bundle; import android.view.Menu; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListAdapter; import android.widget.ListView; import android.widget.Toast; public class MainActivity extends Activity { private Button btn1; private Button btn2; private ListView list1; ArrayList<String> a = new ArrayList<String>(); public boolean LI1 = false; public boolean LI2 = false; public boolean LI3 = false; private ArrayAdapter<String...

Titanium Appcelerator - Android and iPhone Application Development Part-2

If you are new in  Titanium Appcelerator then check first part clickhere create new file in main_windos folder name 'mainscreen.js'; put below code in login.js in button click loginButton.addEventListener('click',function(e){ if(username.value != '' && password.value != ''){ //alert("You are login!"); if(username.value == 'dhaval' && password.value == 'dhaval'){ loSubwin = Titanium.UI.createWindow({ url: 'mainscreen.js', title: 'Home', barColor:'#111' }); Titanium.UI.currentTab.open(loSubwin,{animated:true}); } }else{ alert("Please Enter User name & Password!"); } }); put below code in to 'mainscreen.js' var win = Titanium.UI.currentWindow; var myCars = ne...

Android - get Logs programmatically

Your main Activity : package com . get_Logs ; import java . io . BufferedReader ; import java . io . File ; import java . io . FileOutputStream ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . OutputStreamWriter ; import android . app . Activity ; import android . os . Bundle ; import android . util . Log ; import android . widget . TextView ; public class Get_LogsActivity extends Activity { private TextView textv ; /** Called when the activity is first created. */ @Override public void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ); setContentView ( R . layout . main ); textv = ( TextView ) findViewById ( R . id . textView1 ); getallLogs (); } private void getallLogs () { // TODO Auto-generated method stub try { Process process = Runtime . getRuntime ...