Re: [android-developers] Landscape Portrait and more... advanced question
Use this import android.app.Activity; import android.os.Bundle; import android.view.Window; import android.view.WindowManager; public class Draw extends Activity { DrawView drawView; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Set full screen view getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); requestWindowFeature(Window.FEATURE_NO_TITLE); drawView = new DrawView(this); setContentView(drawView); drawView.requestFocus(); } } package guru.com.aaa; import java.util.ArrayList; import java.util.List; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.util.Log; import android.view.MotionEvent; import android.view.View; import android.view.View.OnTouchListener; public class DrawView extends View implements OnTouchListener { private static final String TAG = DrawView; ListPoint points = new ArrayListPoint(); Paint paint = new Paint(); public DrawView(Context context) { super(context); setFocusable(true); setFocusableInTouchMode(true); this.setOnTouchListener(this); paint.setColor(Color.WHITE); paint.setAntiAlias(true); } @Override public void onDraw(Canvas canvas) { for (Point point : points) { canvas.drawCircle(point.x, point.y, 25, paint); // Log.d(TAG, Painting: +point); } } public boolean onTouch(View view, MotionEvent event) { // if(event.getAction() != MotionEvent.ACTION_DOWN) // return super.onTouchEvent(event); Point point = new Point(); point.x = event.getX(); point.y = event.getY(); points.add(point); invalidate(); Log.d(TAG, point: + point); return true; } } class Point { float x, y; @Override public String toString() { return x + , + y; } } On Thu, Jun 14, 2012 at 12:27 PM, ajaykumar kanchak ajaykumar.kanc...@gmail.com wrote: to draw the circle on touch with the finger use this code this is with the gesture listener public class GesturesActivity extends Activity implements OnGesturePerformedListener { private GestureLibrary mLibrary; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mLibrary = GestureLibraries.fromRawResource(this, R.raw.spells); if (!mLibrary.load()) { finish(); } GestureOverlayView gestures = (GestureOverlayView) findViewById(R.id.gestures); gestures.addOnGesturePerformedListener(this); } public void onGesturePerformed(GestureOverlayView overlay, Gesture gesture) { ArrayListPrediction predictions = mLibrary.recognize(gesture); // We want at least one prediction if (predictions.size() 0) { Prediction prediction = predictions.get(0); // We want at least some confidence in the result if (prediction.score 1.0) { // Show the spell Toast.makeText(this, prediction.name, Toast.LENGTH_SHORT).show(); } } } } On Thu, Jun 14, 2012 at 12:12 PM, Amey Bapat amey.n.ba...@gmail.comwrote: public class Home extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(new MySurface(this)); } } heres da code fr MySurFace public class MySurface extends ImageView { float x, y; Path path = new Path(); public MySurface(Context context) { super(context); this.setLayoutParams( new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT)); this.setOnTouchListener( new OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { x = event.getX(); y = event.getY(); invalidate(); return false; } }); } @Override public boolean onTouchEvent(MotionEvent event) { x = event.getX(); y = event.getY(); invalidate(); return super.onTouchEvent(event); } @Override protected void onDraw(Canvas canvas) { // TODO Auto-generated method stub super.onDraw(canvas); Paint paint = new Paint(); paint.setColor(Color.RED); //canvas.drawLine(x, y, x+20, y+20, paint); path.moveTo(x, y); //path.lineTo(x, y); canvas.drawPath(path, paint); } } just edit some methods fr drawing... check out canvas methods for drwaing stuff.. all da best On Thu, Jun 14, 2012 at 11:51 AM, Sadhna Upadhyay sadhna.braah...@gmail.com wrote: Hi everyone, I am making an app in which i have to to draw circle with the help of finger(on touch listener) in android , can
Re: [android-developers] Re: how to connect ms sql server management studio in android code
You have to user web service for this. On Wed, Jun 13, 2012 at 5:34 PM, lbendlin l...@bendlin.us wrote: This request makes no sense. SQL Server Management Studio is just that, a management suite. You probably meant that you need to connect to a SQL Server database. On Wednesday, June 13, 2012 1:12:07 AM UTC-4, yogeshkumar tiwari wrote: Hi freinds, i am developing an android apps in that i have to save my data in to the microsoft sql server management studio and retrieve the data from the same so please any one have any idea of how to save data on the microsoft sql server managment studio and retrieve the data from same.If any one have code or refrence please share with me freinds. -- With Regards: Yogesh Tiwari (Android Developer) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] mapviewError
Hello deepak, Use this command-: keytool -list -v -keystore C:\Documents and Settings\User\.android\debug.keystore -storepass android -keypass android If you r using window os. This will return MD5 code MD5: 19:13:5F:EB:B4:44:84:B3:7C:C9:64:66:25:A2:12:53 like this Put it into line that i have given already. On Thu, Jun 14, 2012 at 10:22 AM, asheesh arya asheesharya...@gmail.comwrote: just checked out your map apki key !! try to generate new map api key!!! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] mapviewError
Hello deepak please generate ypur own android:apiKey=0n-H5VH- CoBfLf6SnbeZ6uSICn5gF9rA_5eyXrw. follow this link-: https://developers.google.com/android/maps-api-signup besk of luck On Wed, Jun 13, 2012 at 4:59 PM, deepak mamdapure developer.it.a...@gmail.com wrote: plz Suggest me any one i wrote all code for mapview but it does not appeair on emulator it shows only blocks on emulator my code is below pls check is there any correction plz tell me .there is no any error in this code plz suggest me. thank you public class mapDemo extends MapActivity { MyLocationOverlay mlo; MapController mpc; MapView mv; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mv=(MapView)findViewById(R.id.mapview); final LocationManager lm=(LocationManager)getSystemService(Context.LOCATION_SERVICE); final LocationListener ll=new MyLocationListener(); mpc=mv.getController(); mpc.setZoom(18); mlo=new MyLocationOverlay(this,mv); mv.getOverlays().add(mlo); mv.postInvalidate(); final Location location=lm.getLastKnownLocation(LocationManager.GPS_PROVIDER); updateWithNewLocation(location); lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0,ll); mlo.enableMyLocation(); } private void updateWithNewLocation(Location location) { // TODO Auto-generated method stub if (location !=null) { final double lat=location.getLatitude(); final double lng=location.getLongitude(); final GeoPoint mylcation=new GeoPoint((int)(lat*100),(int) (lng*100)); mv.getController().animateTo(mylcation); mv.getController().setCenter(mylcation); } } public class MyLocationListener implements LocationListener{ public void onLocationChanged(final Location location) { // TODO Auto-generated method stub updateWithNewLocation(location); } public void onProviderDisabled(final String provider) { // TODO Auto-generated method stub Toast.makeText(getApplicationContext(),Gps Disabled,Toast.LENGTH_LONG).show(); } public void onProviderEnabled(String provider) { // TODO Auto-generated method stub Toast.makeText(getApplicationContext(),Gps enabled,Toast.LENGTH_LONG).show(); } public void onStatusChanged(final String provider,final int status,final Bundle extras) { // TODO Auto-generated method stub } } @Override protected boolean isRouteDisplayed() { // TODO Auto-generated method stub return false; } } This is my main.xml ?xml version=1.0 encoding=utf-8? RelativeLayout xmlns:android=http://schemas.android.com/apk/res/ android android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent com.google.android.maps.MapView android:id=@+id/map android:layout_width=fill_parent android:layout_height=fill_parent android:apiKey=0n-H5VH- CoBfLf6SnbeZ6uSICn5gF9rA_5eyXrw / LinearLayout android:id=@+id/zlayout android:layout_width=wrap_content android:layout_height=wrap_content android:layout_alignParentBottom=true android:layout_centerHorizontal=true /LinearLayout /RelativeLayout This is my manifest.xml ?xml version=1.0 encoding=utf-8? manifest xmlns:android=http://schemas.android.com/apk/res/android; package=com.ashwath.mapDemo android:versionCode=1 android:versionName=1.0 uses-permission android:name=android.permission.ACCESS_FINE_LOCATION/uses- permission uses-permission android:name=android.permission.ACCESS_COARSE_LOCATION/uses- permission uses-permission android:name=android.permission.INTERNET/uses- permission application android:icon=@drawable/icon android:label=@string/ app_name uses-library android:name=com.google.android.maps/ activity android:name=.mapDemo android:label=@string/app_name intent-filter action android:name=android.intent.action.MAIN / category android:name=android.intent.category.LAUNCHER / /intent-filter /activity /application /manifest -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at
Re: [android-developers] App Security
Ya i can but loge process. On Wed, Jun 13, 2012 at 5:42 PM, Mark Murphy mmur...@commonsware.comwrote: On Wed, Jun 13, 2012 at 8:04 AM, sujit dubey sujit...@gmail.com wrote: Is there a way to prevent reverse engineering on .apk file generated for app? Not really. Obfuscation with ProGuard helps a little. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android Training in NYC: http://marakana.com/training/android/ -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en