Re: [android-developers] Re: Find the location in Android Map

2010-09-16 Thread Dhrumil Shah
Hi Per,

I didnt get it your answer.
What you want to say??

~Dhr

On Thu, Sep 16, 2010 at 11:43 AM, Per p...@care2wear.com wrote:

 Hi there,

 I see at least two issues:
 1: your button click listener takes lat/long from the EditText's, then
 effectively starts the Maps app (Intent url is geo:lat,long).
 2: The GeoPoint constructor takes coordinates that are scaled by
 100, i.e. 45.7 N would be 4570. (see e.g.
 http://developer.android.com/resources/tutorials/views/hello-mapview.html)

 BR
 Per



 On 15 Sep., 19:59, Dhrumil Shah dhrumilsh...@gmail.com wrote:
  Hey TreKing,
 
  If you dont mind, just refer this code.
  You exactly got what is going on here. I am new in Android so I dont know
  what is stack trace and log? How to check stack trace?
 
  So here is my code.
 
  public class ShowLocation extends MapActivity {
  private EditText lat;
  private EditText lng;
   GeoPoint gp=null;
   MapController  mapcontroller;
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
 
  Button btn = (Button)findViewById(R.id.btnShow);
  lat = (EditText)findViewById(R.id.lat);
  lng = (EditText)findViewById(R.id.lng);
 
  MapView mapView = (MapView)findViewById(R.id.myGMap);
 
  mapcontroller = mapView.getController();
 
  //gp = new GeoPoint(lat.intValue(), lng.intValue());
  mapView.setSatellite(true);
  mapView.setTraffic(true);
  mapView.setStreetView(true);
  mapView.displayZoomControls(true);
  mapView.setBuiltInZoomControls(true);
 
  //mapcontroller.animateTo(gp);
  mapcontroller.setZoom(2);
  LocationManager locationManager;
  String context = Context.LOCATION_SERVICE;
  locationManager = (LocationManager)getSystemService(context);
 
  Criteria criteria = new Criteria();
  criteria.setAccuracy(Criteria.ACCURACY_FINE);
  criteria.setAltitudeRequired(true);
  criteria.setBearingRequired(false);
  criteria.setCostAllowed(true);
  criteria.setPowerRequirement(Criteria.POWER_HIGH);
  String provider = locationManager.getBestProvider(criteria,
 true);
 
   Location location = locationManager.getLastKnownLocation(provider);
 
  btn.setOnClickListener(new View.OnClickListener() {
   @Override
  public void onClick(View v) {
  // TODO Auto-generated method stub
  String _lat = lat.getText().toString();
  String _lng = lng.getText().toString();
  Uri uri = Uri.parse(geo:+_lat+,+_lng);
   startActivity(new Intent(Intent.ACTION_VIEW, uri));
  //mapcontroller.animateTo(gp);
  mapcontroller.setZoom(2);}
  });
 
  String _lat,_lng;
  MapOverlay mylocationoverlay = new MapOverlay();
  ListOverlay list = mapView.getOverlays();
  list.add(mylocationoverlay);
  }
   protected class MapOverlay extends com.google.android.maps.Overlay{
   public boolean draw(Canvas canvas, MapView myGMap, boolean shadow, long
  when){
  Paint paint = new Paint();
  //mapcontroller.animateTo(gp);
  super.draw(canvas, myGMap, shadow);
   Point myScreenCoords = new Point();
  //mapview.getProjection().toPixels(gp, myScreenCoords);
  //paint.setARGB(255, 255, 255, 255);
  Drawable marker = getResources().getDrawable(R.drawable.marker);
  Bitmap bitmap = BitmapFactory.decodeResource(getResources(),
  R.drawable.marker);
  canvas.drawBitmap(bitmap, myScreenCoords.x, myScreenCoords.y, paint);
  canvas.drawText(Location is at here.., myScreenCoords.x,
 myScreenCoords.y,
  paint);
  return true;}
  }
 
   @Override
  protected boolean isRouteDisplayed() {
  // TODO Auto-generated method stub
  return false;
 
  }
  }
 
  ~Dhr
 
 
 
  On Wed, Sep 15, 2010 at 11:17 PM, TreKing treking...@gmail.com wrote:
   On Wed, Sep 15, 2010 at 12:42 PM, Dhrumil Shah dhrumilsh...@gmail.com
 wrote:
 
   You can change this at any time.
   - Ya, i know that thing, but its not working in my this application.
 
   It's not working is not useful information.
 
   Or you can animate or snap to the exact location.
   - I used this method but it generates and force close error on my
   emulator.
 
   Did you check the stack trace?
 
   Why not?
   -I dont know why not. I try to debug it but it gives me nothing.
 
   Nothing? No logs, no stack trace?
 
  
 ---
 --
   TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
   transit tracking app for Android-powered devices
 
--
   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.comandroid-developers

[android-developers] Find the location in Android Map

2010-09-15 Thread dhrumil
Hello 2 All,

I m working on my one application in that user have to put latitude
and longitude of the location and after pressing the button the map
shows that location.

I have a problem in that.

Can anyone help me to solve it out?

~Dhr

-- 
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] Find the location in Android Map

2010-09-15 Thread Dhrumil Shah
The problem is that I am not able to find that exact location and not able
to put marker on that location.

~Dhr

On Wed, Sep 15, 2010 at 6:01 PM, TreKing treking...@gmail.com wrote:

  On Wed, Sep 15, 2010 at 7:18 AM, dhrumil dhrumilsh...@gmail.com wrote:

 I have a problem in that.


 And the problem is what?


 -
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
 transit tracking app for Android-powered devices


 --
 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.comandroid-developers%2bunsubscr...@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] Find the location in Android Map

2010-09-15 Thread Dhrumil Shah
The exact location is the location entered by the user in the edit text i.e.
the latitude and longitude of that location.

If u didnt get my question, I can send u my code then run it and suggest me.

~Dhr

On Wed, Sep 15, 2010 at 7:00 PM, TreKing treking...@gmail.com wrote:

  On Wed, Sep 15, 2010 at 7:37 AM, Dhrumil Shah dhrumilsh...@gmail.comwrote:

 The problem is that I am not able to find that exact location and not able
 to put marker on that location.


 And what exactly is that exact location?



 -
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
 transit tracking app for Android-powered devices

 --
 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.comandroid-developers%2bunsubscr...@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] Find the location in Android Map

2010-09-15 Thread Dhrumil Shah
The problem is that zoom of the map is maximum, every time I have to zoom
out the map to show the exact location. And I am not able to put marker on
that location.

~Dhr

On Wed, Sep 15, 2010 at 7:40 PM, TreKing treking...@gmail.com wrote:

 On Wed, Sep 15, 2010 at 8:46 AM, Dhrumil Shah dhrumilsh...@gmail.comwrote:

 The exact location is the location entered by the user in the edit text
 i.e. the latitude and longitude of that location.


 OK. So user entered location as lat and lon. Why can't you plot it? What's
 the EXACT problem? What have you tried so far?


  If u didnt get my question, I can send u my code then run it and suggest
 me.


 No.


 -
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
 transit tracking app for Android-powered devices

  --
 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.comandroid-developers%2bunsubscr...@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] Find the location in Android Map

2010-09-15 Thread Dhrumil Shah
You can change this at any time.
- Ya, i know that thing, but its not working in my this application.

Or you can animate or snap to the exact location.
- I used this method but it generates and force close error on my emulator.

Why not?
-I dont know why not. I try to debug it but it gives me nothing.

~Dhr

On Wed, Sep 15, 2010 at 10:46 PM, TreKing treking...@gmail.com wrote:

 On Wed, Sep 15, 2010 at 12:14 PM, Dhrumil Shah dhrumilsh...@gmail.comwrote:

 The problem is that zoom of the map is maximum


 You can change this at any time.


 every time I have to zoom out the map to show the exact location.


 Or you can animate or snap to the exact location.


 And I am not able to put marker on that location.


 Why not?



 -
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
 transit tracking app for Android-powered devices

  --
 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.comandroid-developers%2bunsubscr...@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] Find the location in Android Map

2010-09-15 Thread Dhrumil Shah
Hey TreKing,

If you dont mind, just refer this code.
You exactly got what is going on here. I am new in Android so I dont know
what is stack trace and log? How to check stack trace?

So here is my code.

public class ShowLocation extends MapActivity {
private EditText lat;
private EditText lng;
 GeoPoint gp=null;
 MapController  mapcontroller;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

Button btn = (Button)findViewById(R.id.btnShow);
lat = (EditText)findViewById(R.id.lat);
lng = (EditText)findViewById(R.id.lng);

MapView mapView = (MapView)findViewById(R.id.myGMap);

mapcontroller = mapView.getController();

//gp = new GeoPoint(lat.intValue(), lng.intValue());
mapView.setSatellite(true);
mapView.setTraffic(true);
mapView.setStreetView(true);
mapView.displayZoomControls(true);
mapView.setBuiltInZoomControls(true);

//mapcontroller.animateTo(gp);
mapcontroller.setZoom(2);
LocationManager locationManager;
String context = Context.LOCATION_SERVICE;
locationManager = (LocationManager)getSystemService(context);

Criteria criteria = new Criteria();
criteria.setAccuracy(Criteria.ACCURACY_FINE);
criteria.setAltitudeRequired(true);
criteria.setBearingRequired(false);
criteria.setCostAllowed(true);
criteria.setPowerRequirement(Criteria.POWER_HIGH);
String provider = locationManager.getBestProvider(criteria, true);

 Location location = locationManager.getLastKnownLocation(provider);

btn.setOnClickListener(new View.OnClickListener() {
 @Override
public void onClick(View v) {
// TODO Auto-generated method stub
String _lat = lat.getText().toString();
String _lng = lng.getText().toString();
Uri uri = Uri.parse(geo:+_lat+,+_lng);
 startActivity(new Intent(Intent.ACTION_VIEW, uri));
//mapcontroller.animateTo(gp);
mapcontroller.setZoom(2);
}
});
String _lat,_lng;
MapOverlay mylocationoverlay = new MapOverlay();
ListOverlay list = mapView.getOverlays();
list.add(mylocationoverlay);
}
 protected class MapOverlay extends com.google.android.maps.Overlay{
 public boolean draw(Canvas canvas, MapView myGMap, boolean shadow, long
when){
Paint paint = new Paint();
//mapcontroller.animateTo(gp);
super.draw(canvas, myGMap, shadow);
 Point myScreenCoords = new Point();
//mapview.getProjection().toPixels(gp, myScreenCoords);
//paint.setARGB(255, 255, 255, 255);
Drawable marker = getResources().getDrawable(R.drawable.marker);
Bitmap bitmap = BitmapFactory.decodeResource(getResources(),
R.drawable.marker);
canvas.drawBitmap(bitmap, myScreenCoords.x, myScreenCoords.y, paint);
canvas.drawText(Location is at here.., myScreenCoords.x, myScreenCoords.y,
paint);
return true;
}
}
 @Override
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
}
}

~Dhr


On Wed, Sep 15, 2010 at 11:17 PM, TreKing treking...@gmail.com wrote:

 On Wed, Sep 15, 2010 at 12:42 PM, Dhrumil Shah dhrumilsh...@gmail.comwrote:

 You can change this at any time.
 - Ya, i know that thing, but its not working in my this application.


 It's not working is not useful information.


 Or you can animate or snap to the exact location.
 - I used this method but it generates and force close error on my
 emulator.


 Did you check the stack trace?


 Why not?
 -I dont know why not. I try to debug it but it gives me nothing.


 Nothing? No logs, no stack trace?


 -
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
 transit tracking app for Android-powered devices

  --
 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.comandroid-developers%2bunsubscr...@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] Find the location in Android Map

2010-09-15 Thread Dhrumil Shah
Hey Frank,

Then you told me what do I do??

~Dhr

On Thu, Sep 16, 2010 at 12:43 AM, Frank Weiss fewe...@gmail.com wrote:

 I see a couple of issues with your code.

 1) The location variable set in the following line does not appear to be
 used anywher:

 Location location = locationManager.getLastKnownLocation(provider);

 2) Are you trying to send an intent to the Maps or Browser app, of handle
 the location display yourself? In one place the code has:

 startActivity(new Intent(Intent.ACTION_VIEW, uri));

 yet in another line, the code goes:

 canvas.drawBitmap(bitmap, myScreenCoords.x, myScreenCoords.y, paint);

 --
 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.comandroid-developers%2bunsubscr...@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] Find the location in Android Map

2010-09-15 Thread Dhrumil Shah
I thought you want to to display a mark on a map from the latitude and
longitude a user entered in two text fields. But I don't understand if you
want to display that on a MapActivity in your app or in another app.
- I want to display that  on a MapActivity in my app. Not in another
activity.


One thing that may help is if you try to display a mark on a map foir a
given latitude and longitude instead of from a user's input. Have you been
able to do that successfully?
- Yes, I tried with that also. Firstly, I entered hardcore values in the app
of latitude and longitude. Its working.
But everytime we have to change it for different locations. Thats why I put
EditText and button so user can enter its own latitude and longitude.

~Dhr.

On Thu, Sep 16, 2010 at 9:27 AM, Frank Weiss fewe...@gmail.com wrote:

 I want to help you, but I don't clearly understand what you want to do.

 I thought you want to to display a mark on a map from the latitude and
 longitude a user entered in two text fields. But I don't understand if you
 want to display that on a MapActivity in your app or in another app.

 One thing that may help is if you try to display a mark on a map foir a
 given latitude and longitude instead of from a user's input. Have you been
 able to do that successfully?

 --
 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.comandroid-developers%2bunsubscr...@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

[android-developers] Create Thumbnail.

2010-09-09 Thread dhrumil
Hello 2All,

I create one Gallery Example. In that If I want to do Thumbnail like
display what is d code.?

-- 
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


[android-developers] Image Viewer Problem

2010-09-08 Thread dhrumil
Hello 2All,

I tried to develop imageviewer but its not working. during the run
time it generates an error.

What will do?

-- 
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] Re: PhotoViewer

2010-09-07 Thread Dhrumil Shah
I am new in Android.
Can you help me how to put GridView ?

~Dhrumil
On Tue, Sep 7, 2010 at 11:07 AM, AJ ajeet.invinci...@gmail.com wrote:

 If you want to display photo one by one then take FrameLayout, else
 you can take GridLayout.

 Hope this helps.


 Thanks,
 AJ

 On Sep 7, 10:26 am, dhrumil dhrumilsh...@gmail.com wrote:
  Hello,
  Is there anybody who has a knowledge about Photo Viewer in Android.
 
  If I want to develop one photo viewer then how can I do this??
 
  ~Dhrumil

 --
 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.comandroid-developers%2bunsubscr...@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] Upgrade my Game Application

2010-09-07 Thread Dhrumil Shah
Hello,

Hope you all got what I mean to develop.
Please give me suggestions for upgrading my game.

~Dhrumil

On Mon, Sep 6, 2010 at 6:45 PM, { Devdroid } webnet.andr...@gmail.comwrote:

 On 6 September 2010 14:42, Dhrumil Shah dhrumilsh...@gmail.com wrote:
  Hi Sandeep,
 
  I try to change it, but it shows an error like this:
 
  error: Error: Float types not allowed (at 'versionCode' with value
 '1.1').

 You should not change things you do not understand in hope it will work
 even you do not know why. There's clear error message quoted above
 and there's manual you shall read to get what value is valid there:
 http://developer.android.com/guide/publishing/versioning.html

 --
  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.comandroid-developers%2bunsubscr...@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] Upgrade my Game Application

2010-09-07 Thread Dhrumil Shah
I send my code.
In that code, I want to put Bouncing Ball. But I am not getting how to put
it.
I am very much thankful for you if you are helping me.

~Dhrumil

On Tue, Sep 7, 2010 at 12:41 PM, Miguel Morales therevolti...@gmail.comwrote:

 I'm having trouble understanding your question, what isn't being
 upgraded?  The code?  Have you tried logging some debug text?  Are you
 using the emulator?  How are you installing your app.  Also, please
 use pastebin to post code.

 On Mon, Sep 6, 2010 at 11:55 PM, Dhrumil Shah dhrumilsh...@gmail.com
 wrote:
  Hello,
 
  Hope you all got what I mean to develop.
  Please give me suggestions for upgrading my game.
 
  ~Dhrumil
 
  On Mon, Sep 6, 2010 at 6:45 PM, { Devdroid } webnet.andr...@gmail.com
  wrote:
 
  On 6 September 2010 14:42, Dhrumil Shah dhrumilsh...@gmail.com wrote:
   Hi Sandeep,
  
   I try to change it, but it shows an error like this:
  
   error: Error: Float types not allowed (at 'versionCode' with value
   '1.1').
 
  You should not change things you do not understand in hope it will work
  even you do not know why. There's clear error message quoted above
  and there's manual you shall read to get what value is valid there:
  http://developer.android.com/guide/publishing/versioning.html
 
  --
  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.comandroid-developers%2bunsubscr...@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.comandroid-developers%2bunsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en



 --
 ~ Jeremiah:9:23-24
 Android 2D MMORPG: http://developingthedream.blogspot.com/,
 http://diastrofunk.com,
 http://www.youtube.com/user/revoltingx

 --
  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.comandroid-developers%2bunsubscr...@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] Upgrade my Game Application

2010-09-07 Thread Dhrumil Shah
Hello Miguel,

Sorry for my fault.
-I write my code in Eclipse platform and run in Android SDK version = 1.
-I tried to debug it but I am not getting my solution. I think the problem
is overlapping of CANVAS.
How to solve overlapping canvas problem.

~Dhrumil.

On Tue, Sep 7, 2010 at 2:07 PM, Miguel Morales therevolti...@gmail.comwrote:

 You did not answer any of my questons, did you try logging?  Are you
 using the emulator?  How are you installing your app?
 We're not going to waste our time running or reading badly formatted
 code without a good description of the problem.

 On Tue, Sep 7, 2010 at 1:30 AM, Dhrumil Shah dhrumilsh...@gmail.com
 wrote:
  I send my code.
  In that code, I want to put Bouncing Ball. But I am not getting how to
 put
  it.
  I am very much thankful for you if you are helping me.
 
  ~Dhrumil
 
  On Tue, Sep 7, 2010 at 12:41 PM, Miguel Morales therevolti...@gmail.com
 
  wrote:
 
  I'm having trouble understanding your question, what isn't being
  upgraded?  The code?  Have you tried logging some debug text?  Are you
  using the emulator?  How are you installing your app.  Also, please
  use pastebin to post code.
 
  On Mon, Sep 6, 2010 at 11:55 PM, Dhrumil Shah dhrumilsh...@gmail.com
  wrote:
   Hello,
  
   Hope you all got what I mean to develop.
   Please give me suggestions for upgrading my game.
  
   ~Dhrumil
  
   On Mon, Sep 6, 2010 at 6:45 PM, { Devdroid } 
 webnet.andr...@gmail.com
   wrote:
  
   On 6 September 2010 14:42, Dhrumil Shah dhrumilsh...@gmail.com
 wrote:
Hi Sandeep,
   
I try to change it, but it shows an error like this:
   
error: Error: Float types not allowed (at 'versionCode' with value
'1.1').
  
   You should not change things you do not understand in hope it will
 work
   even you do not know why. There's clear error message quoted above
   and there's manual you shall read to get what value is valid there:
   http://developer.android.com/guide/publishing/versioning.html
  
   --
   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.comandroid-developers%2bunsubscr...@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.comandroid-developers%2bunsubscr...@googlegroups.com
   For more options, visit this group at
   http://groups.google.com/group/android-developers?hl=en
 
 
 
  --
  ~ Jeremiah:9:23-24
  Android 2D MMORPG: http://developingthedream.blogspot.com/,
  http://diastrofunk.com,
  http://www.youtube.com/user/revoltingx
 
  --
  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.comandroid-developers%2bunsubscr...@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.comandroid-developers%2bunsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en



 --
 ~ Jeremiah:9:23-24
 Android 2D MMORPG: http://developingthedream.blogspot.com/,
 http://diastrofunk.com,
 http://www.youtube.com/user/revoltingx

 --
 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.comandroid-developers%2bunsubscr...@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] launching new instance --- Urgent help needed

2010-09-07 Thread Dhrumil Shah
Have you tried to develop this? If yes, paste ur code

~Dhrumil

On Tue, Sep 7, 2010 at 4:15 PM, Revathi K J Ramanan 
revathiramana...@gmail.com wrote:

 Hi,

 I have two activities.A and B.
 A starts B.Both are running in the screen and both are visible. Say
 now B is visible.

 On a special key press, I want to bring the A to the front and make it
 active.
 The problem I am facing is when the special key is pressed, another
 instance of A is launched and the new instance is brought to the
 front.

 But I want the original A to come to the front. I want to make this
 change in the framework layer rather than application specific by
 using the singleInstance theme in the launchMode in AndroidManifest
 file.

 Please help me in this regard as this is really urgent for me.
 Any inputs will be really valuable for me.

 Thanks in advance.

 Regards,
 Revathi K J Ramanan

 --
 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.comandroid-developers%2bunsubscr...@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

[android-developers] Upgrade my Game Application

2010-09-06 Thread dhrumil
Hello 2all,

I have developed one simple game application.
In that, the box is moving in all four directions. Now I want to
upgrade my game. So for that I just add one ball image on this
application. This ball image is bouncing all over the android screen.
I tried a lot but not able to upgrade my game. The only box is visible
on the screen and the ball image is not visible.

I want to display both of them on the screen.
How to do this?
Any suggestions.
Please anyone knows give me a reply.

~Dhrumil

-- 
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] Upgrade my Game Application

2010-09-06 Thread Dhrumil Shah
* *void* onDraw(Canvas canvas){

*if*(myPoint.x= *this*.getWidth() - myPosition.getBounds().width()){

*this*.myXDirection = HorizontalDirection.*LEFT*;

}

*else* *if*(myPoint.x = 0){

*this*.myXDirection = HorizontalDirection.*RIGHT*;

}

*if*(myPoint.y= *this*.getHeight() - myPosition.getBounds().height()){

*this*.myYDirection = VerticalDirection.*UP*;

}

*else* *if*(myPoint.y=0){

*this*.myYDirection = VerticalDirection.*DOWN*;

}

*if*(*this*.myXDirection == HorizontalDirection.*RIGHT*){

*this*.myPoint.x += 10;

}

*else*{

*this*.myPoint.x -= 10;

}

*if*(*this*.myYDirection == VerticalDirection.*DOWN*){

*this*.myPoint.y += 10;

}

*else*{

*this*.myPoint.y -= 10;

}

*this*.myPosition.setBounds(*this*.myPoint.x, *this*.myPoint.y, *this*.
myPoint.x + 50, *this*.myPoint.y + 50);

*this*.myPosition.draw(canvas);

}

}

This is my code. In that game, the box is moving left, right , top and down.
In the same, I used one image of ball, which is bouncing. But my problem is
the bouncing ball is not visible.

How to solve it? Please suggest me.
~Dhrumil




On Mon, Sep 6, 2010 at 4:26 PM, Miguel Morales therevolti...@gmail.comwrote:

 How are you upgrading your game?

 On Mon, Sep 6, 2010 at 3:28 AM, dhrumil dhrumilsh...@gmail.com wrote:
  Hello 2all,
 
  I have developed one simple game application.
  In that, the box is moving in all four directions. Now I want to
  upgrade my game. So for that I just add one ball image on this
  application. This ball image is bouncing all over the android screen.
  I tried a lot but not able to upgrade my game. The only box is visible
  on the screen and the ball image is not visible.
 
  I want to display both of them on the screen.
  How to do this?
  Any suggestions.
  Please anyone knows give me a reply.
 
  ~Dhrumil
 
  --
  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.comandroid-developers%2bunsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en



 --
 ~ Jeremiah:9:23-24
 Android 2D MMORPG: http://developingthedream.blogspot.com/,
 http://diastrofunk.com,
 http://www.youtube.com/user/revoltingx

 --
  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.comandroid-developers%2bunsubscr...@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] Upgrade my Game Application

2010-09-06 Thread Dhrumil Shah
Hi Sandeep,

I try to change it, but it shows an error like this:

error: Error: Float types not allowed (at 'versionCode' with value '1.1').
~Dhrumil

On Mon, Sep 6, 2010 at 5:59 PM, Sandeep Phansekar 
sandeep.phanse...@gmail.com wrote:

 Hi

 Just Change the *android:versionCode=1.1*  present in the mainfest.xml
 file

 regards
 sandeep


   On Mon, Sep 6, 2010 at 5:39 PM, Dhrumil Shah dhrumilsh...@gmail.comwrote:

   I developed one game its code is here:

 *Testing.java*
 *

 package
 *com.paad.testing;

 *

 import
 *android.app.Activity;*

 import
 *android.os.Bundle;*

 import
 *android.os.Handler;*

 import
 *android.os.Message;*

 import
 *android.view.*;*

 import
 *android.graphics.*;*

 import
 *android.content.*;

 *

 public
 **class* Testing *extends* Activity {

 RandomView
 randomView = *null*;

 *public* *static* *final* *int* *DIRECTION_RIGHT* = 0, *DIRECTION_LEFT* =
 1, *DIRECTION_DOWN* = 2, *DIRECTION_UP* = 3;

 *protected* *static* *final* *int* *GUIUPDATEIDENTIFIER* = 0x101;

 *private* Panel main;

 *private* Bitmap scratch;

 *private* Canvas offscreen;

 *public* *boolean* start = *true*;

 *private* *volatile* *boolean* running = *false*;

 *private* *int* direction = *DIRECTION_RIGHT*;

 *private* *int* boxx = 10;

 *private* *int* boxy = 10;

 Thread
 myRefreshThread = *null*;

 Handler
 GUIUpdateHandler = *new* Handler() {

 // @Override

 *public* *void* handleMessage(Message msg) {

 *switch* (msg.what) {

 *case* Testing.*GUIUPDATEIDENTIFIER*:

 randomView.invalidate();

 *break*;

 }

 *super*.handleMessage(msg);

 }

 };

 @Override

 *public* *void* onCreate(Bundle savedInstanceState)

 {

 *super*.onCreate(savedInstanceState);

 *this*.randomView = *new* RandomView(*this*);

 *this*.setContentView(*this*.randomView);

 (
 *new* Thread(*new* Refresh())).start();

 setOffscreenBitmap();

 main = *new* Panel(*this*);

 setContentView(
 main,*new* ViewGroup.LayoutParams(320,480));

 (
 *new* Thread(*new* AnimationLoop())).start();

 }

 *private* *void* setOffscreenBitmap()

 {

 scratch = Bitmap.*createBitmap*(30,30,Bitmap.Config.*ARGB_*);

 offscreen = *new* Canvas();

 offscreen.setBitmap(scratch);

 offscreen.drawColor(Color.*RED*);

 }

 *private* *synchronized* *void* updatePhysics()

 {

 *if*(boxx  10){

 direction = *DIRECTION_RIGHT*;

 }

 *else* *if*(boxx  250){

 direction = *DIRECTION_LEFT*;

 }

 *if*(boxy  10){

 direction = *DIRECTION_DOWN*;

 }

 *else* *if*(boxy  350){

 direction = *DIRECTION_UP*;

 }

 *if*(direction == *DIRECTION_RIGHT*){

 boxx = boxx + 10;

 }

 *else* *if* (direction == *DIRECTION_LEFT*)

 {

 boxx = boxx - 10;

 }

 *else* *if*(direction == *DIRECTION_UP*){

 boxy = boxy - 10;

 }

 *else* *if*(direction == *DIRECTION_DOWN*){

 boxy = boxy + 10;

 }

 *else*{

 //Do nothing

 }

 }

 *private* *synchronized* *void* doDraw(Canvas canvas, Paint paint)

 {

 *if*(start)

 {

 canvas.drawColor(Color.
 *GREEN*);

 canvas.drawBitmap(
 scratch,10,10,paint);

 start = *false*;

 }

 *else*

 {

 canvas.save();

 canvas.clipRect(
 boxx,boxy,boxx+30,boxy+30);

 canvas.drawColor(Color.
 *RED*);

 canvas.drawBitmap(
 scratch,boxx,boxy,paint);

 canvas.restore();

 }

 }

 //@Override

 *public* *boolean* onKeyDown(*int* keyCode, KeyEvent event){

 *if*(keyCode == KeyEvent.*KEYCODE_DPAD_CENTER*){

 *if*(running!=*true*){

 running = *true*;

 }

 *else*{

 running = *false*;

 }

 }

 *else* *if*(keyCode == KeyEvent.*KEYCODE_DPAD_LEFT*){

 direction = *DIRECTION_LEFT*;

 }

 *else* *if*(keyCode == KeyEvent.*KEYCODE_DPAD_RIGHT*){

 direction = *DIRECTION_RIGHT*;

 }

 *else* *if*(keyCode == KeyEvent.*KEYCODE_DPAD_DOWN*){

 direction = *DIRECTION_DOWN*;

 }

 *else* *if* (keyCode == KeyEvent.*KEYCODE_DPAD_UP*){

 direction = *DIRECTION_UP*;

 }

 *else* *if*(keyCode == KeyEvent.*KEYCODE_BACK*){

 finish();

 }

 *return* *true*;

 }

 *class* Panel *extends* View

 {

 Paint
 paint;

 *public* Panel(Context context)

 {

 *super*(context);

 paint = *new* Paint();

 }

 @Override

 *protected* *void* onDraw(Canvas canvas)

 {

 doDraw(canvas,
 paint);

 }

 }

 *class* AnimationLoop *implements* Runnable

 {

 *public* *void* run()

 {

 *while*(*true*)

 {

 *while*(running)

 {

 *try*

 {

 Thread.*sleep*(100);

 }

 *catch*(InterruptedException ex) {}

 updatePhysics();

 main.postInvalidate();

 }

 }

 }

 }

 *class* Refresh *implements* Runnable{

 *public* *void* run(){

 *while*(!Thread.*currentThread*().isInterrupted()){

 Message message =
 *new* Message();

 message.
 what = Testing.*GUIUPDATEIDENTIFIER*;

 Testing.
 *this*.GUIUpdateHandler.sendMessage(message);

 *try*{

 Thread.*sleep*(100);

 }

 *catch* (Exception e) {

 Thread.*currentThread*().interrupt();

 }

 }

 }

 }

 }
 my another class file:
 *RandomView.java*

 **
 *

 package
 *com.paad.testing;

 *

 import
 *android.content.Context;*

 import
 *android.graphics.Canvas;*

 import
 *android.graphics.Color;*

 import
 *android.graphics.Point;*

 import

[android-developers] PhotoViewer

2010-09-06 Thread dhrumil
Hello,
Is there anybody who has a knowledge about Photo Viewer in Android.

If I want to develop one photo viewer then how can I do this??

~Dhrumil

-- 
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] Re: How to use D-Pad control in Android

2010-09-05 Thread Dhrumil Shah
Hello ko5tik,

Ok, then here is my code which is animates my ball.

package padd.testing;

import android.app.Activity;
import android.os.Bundle;
import android.view.*;
//import android.view.View.OnClickListener;
import android.graphics.*;
import android.content.*;
//import android.widget.Button;

public class Testing extends Activity
{
public static final int DIRECTION_RIGHT = 0, DIRECTION_LEFT = 1,
DIRECTION_UP = 2, DIRECTION_DOWN= 3;

private Panel main;
private Bitmap scratch;
private Canvas offscreen;
public boolean start = true;
private volatile boolean running = true;
private int direction = DIRECTION_RIGHT;
private int box = 10;

@Override

public void onCreate(Bundle savedInstanceState)
{
 super.onCreate(savedInstanceState);
 setOffscreenBitmap();
 //Button danger = (Button)findViewById(R.id.Button01);
 main = new Panel(this);
setContentView(main,new ViewGroup.LayoutParams(320,480));



/*danger.setOnClickListener( new OnClickListener(){
 public void onClick(View v){
 if(v.isPressed()==true){
 (new Thread(new AnimationLoop())).start();
 }
 }
});*/

(new Thread(new AnimationLoop())).start();

}


private void setOffscreenBitmap()
{
 scratch = Bitmap.createBitmap(30,30,Bitmap.Config.ARGB_);
 offscreen = new Canvas();
 offscreen.setBitmap(scratch);
 offscreen.drawColor(Color.GREEN);
}
private synchronized void updatePhysics()
{
if(box  10)
{
direction = DIRECTION_RIGHT;
}
else if(box  250)
{
direction = DIRECTION_LEFT;
}

if(direction == DIRECTION_RIGHT)
{
box = box + 10;
}
else
{
box = box - 10;
}
}
private synchronized void doDraw(Canvas canvas, Paint paint)
{
if(start)
{
 canvas.drawColor(Color.BLACK);
canvas.drawBitmap(scratch,10,10,paint);
start = false;
}
else
{
 canvas.save();
 canvas.clipRect(box,8,box+32,40);
 canvas.drawColor(Color.RED);
 canvas.drawBitmap(scratch,box,10,paint);
 canvas.restore();
}
 }

@Override
public boolean onKeyDown(int keyCode, KeyEvent event)
{
if(keyCode == KeyEvent.KEYCODE_DPAD_CENTER)
{
if(running)
{
running = false;
}
else
{
running = true;
}
}
else if(keyCode == KeyEvent.KEYCODE_DPAD_LEFT){
 direction = DIRECTION_LEFT;
}
else if (keyCode == KeyEvent.KEYCODE_DPAD_RIGHT){
 direction = DIRECTION_RIGHT;
}
else if (keyCode == KeyEvent.KEYCODE_DPAD_UP){
 direction = DIRECTION_UP;
}
else if (keyCode == KeyEvent.KEYCODE_DPAD_DOWN)
{
finish();
}
return true;
}
class Panel extends View
{
Paint paint;
public Panel(Context context)
{
super(context);
paint = new Paint();
}
@Override
protected void onDraw(Canvas canvas)
{
doDraw(canvas,paint);
}
}
   class AnimationLoop implements Runnable
   {
   public void run()
{
while(true)
{
while(running)
{
try
{
Thread.sleep(100);
}
catch(InterruptedException ex) {}
updatePhysics();
main.postInvalidate();
}
}
}
}
}




On Sun, Sep 5, 2010 at 5:37 PM, ko5tik kpriblo...@yahoo.com wrote:



 On Sep 3, 3:34 pm, Dhrumil Shah dhrumilsh...@gmail.com wrote:
  Hey Avigadl,
 
  If I change the values of the each direction like DIRECTION_TOP = 0,
  DIRECTION_DOWN = 1, DIRECTION_RIGHT = 2, DIRECTION_LEFT = 3; it is
 working?
 
  I changed that but unfortunetly its not working.
  Any other Solution?

 Then show us a code which is animates your ball

 --
 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.comandroid-developers%2bunsubscr...@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

[android-developers] Guidance

2010-09-03 Thread dhrumil
Hello,

I am Dhrumil Shah.
I am new in Android World.
I wanted to learn different things related to Android specially
Android Games.
And I tried to develope one simple and sweet game.
But this is not working.

Can anyone please help me to solve it out?

Thanks/Regards,
Dhrumil Shah.

-- 
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


[android-developers] Need Help

2010-09-03 Thread dhrumil
Hello,

I am Dhrumil Shah. I am new in Android World.
I tried to develop one simple game application but it has one minor
error and I am not getting what is the error.
Can anyone here help me to solve it out?

~Dhrumil Shah.

-- 
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


[android-developers] button and circle

2010-09-03 Thread dhrumil
Hello,

I have a question that I wanted to put button and circle on the same
canvas.
How can I do this?
Please give reply as soon as possible.

~Dhrumil

-- 
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


[android-developers] How to use D-Pad control in Android

2010-09-03 Thread dhrumil
Hello 2All,

I have a problem in handling my ball using D-Pad control.

Here is my code of handling a ball.


public static final int DIRECTION_RIGHT = 0, DIRECTION_UP = 0,
DIRECTION_DOWN = 0, DIRECTION_LEFT = 0;
private int direction = 0;
protected volatile boolean running = true;
public boolean onKeyDown(int KeyCode, KeyEvent event){
if(KeyCode==KeyEvent.KEYCODE_DPAD_CENTER){

if(running == true){

if(KeyCode == KeyEvent.KEYCODE_DPAD_RIGHT){
setDirection(DIRECTION_RIGHT);
}
else if(KeyCode == KeyEvent.KEYCODE_DPAD_DOWN){
setDirection(DIRECTION_DOWN);
}
else if(KeyCode == KeyEvent.KEYCODE_DPAD_LEFT){
setDirection(DIRECTION_LEFT);
}
}
}
else {
running = false;
}

return true;
}

public void setDirection(int direction) {
this.direction = direction;
}

public int getDirection() {
return direction;
}

-- 
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] listView: how to add text view on top of the list

2010-09-03 Thread Dhrumil Shah
Hello Ankit,

Thanks for this.
Its working.
Thanks very much.

Regards/Thanks,
Dhrumil

On Fri, Sep 3, 2010 at 6:26 PM, A N K ! T ankit.awasth...@gmail.com wrote:

 but how where to write it
 layout code is

 LinearLayout
   xmlns:android=http://schemas.android.com/apk/res/android;
   android:layout_height=wrap_content android:layout_width=fill_parent
  ImageView
 android:id=@+id/icon
 android:layout_width=40sp
 android:layout_height=wrap_content
  android:src=@drawable/on android:visibility=visible/
 TextView
 android:id=@+id/label
 android:layout_width=wrap_content
 android:layout_height=wrap_content
 android:textSize=20sp/

 /LinearLayout



 On Fri, Sep 3, 2010 at 6:00 PM, Mark Murphy mmur...@commonsware.comwrote:

 If you want it to scroll with the list, use addHeaderView(). If you do
 not want it to scroll with the list, put it above the ListView using a
 LinearLayout or RelativeLayout.

 On Fri, Sep 3, 2010 at 8:28 AM, A N K ! T ankit.awasth...@gmail.com
 wrote:
  am making a list by this code
 
  public class myList extends ListActivity{
 
   private static EfficientAdapter efficientAdapter;
  private static class EfficientAdapter extends BaseAdapter {
  static Bitmap bmp[] = new Bitmap[3];
  private LayoutInflater mInflater;
 
 
 
  public EfficientAdapter(Context context) {
  mInflater = LayoutInflater.from(context);
 
  bmp[1] =
 BitmapFactory.decodeResource(context.getResources(),
  R.drawable.icon1);
  bmp[2] =
 BitmapFactory.decodeResource(context.getResources(),
  R.drawable.icon2);
  bmp[3] =
  BitmapFactory.decodeResource(context.getResources(),R.drawable.icon3);
 
  }
 
 
  public int getCount() {
  return DATA.length;
  }
 
 
  public Object getItem(int position) {
 
  return position;
  }
 
 
  public long getItemId(int position) {
  return position;
  }
 
   iew(int position, View convertView, ViewGroup parent) {
 
  ViewHolder holder;
  if (convertView == null) {
 
  convertView = mInflater.inflate(R.layout.mainscreen,
 null);
 
  holder = new ViewHolder();
  holder.text = (TextView)
  convertView.findViewById(R.id.label);
  holder.icon = (ImageView)
  convertView.findViewById(R.id.icon);
  holder.text.setGravity(Gravity.CENTER_VERTICAL);
  holder.text.setHeight(64);
  holder.icon.setMinimumHeight(64);
  convertView.setTag(holder);
 
  } else {
  holder = (ViewHolder) convertView.getTag();
  }
 
  holder.text.setText(DATA[position]);
  holder.icon.setImageBitmap((bmp[position]));
 
  return convertView;
  }
 
  static class ViewHolder {
  TextView text;
  ImageView icon;
 
  }
  }
 
 
 
  @Override
  protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  efficientAdapter = new EfficientAdapter(this);
 
  setListAdapter(efficientAdapter);
 
 
  and want to add a text view on the top of list...but it should not be
 the
  list item
 
  --
 
   A N K ! T..
 
 
  --
  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.comandroid-developers%2bunsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en



 --
 Mark Murphy (a Commons Guy)
 http://commonsware.com | http://github.com/commonsguy
 http://commonsware.com/blog | http://twitter.com/commonsguy

 _The Busy Coder's Guide to Android Development_ Version 3.1 Available!

 --
 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.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




 --

  A N K ! T..


 --
 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.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


-- 
You received this message because you

Re: [android-developers] Re: How to use D-Pad control in Android

2010-09-03 Thread Dhrumil Shah
Hey Avigadl,

If I change the values of the each direction like DIRECTION_TOP = 0,
DIRECTION_DOWN = 1, DIRECTION_RIGHT = 2, DIRECTION_LEFT = 3; it is working?

I changed that but unfortunetly its not working.
Any other Solution?

On Fri, Sep 3, 2010 at 5:26 PM, avigadl avig...@gmail.com wrote:

 Several suggestions:
 1. Note that all the directions has value 0, this might be a poblem
 wen you want to distinguish between directions. You have to set  a
 unique value to eac direction.
 2. We suggest to use switch case statement instead of if else if.

 Hope this helps.



 On Sep 3, 12:35 pm, dhrumil dhrumilsh...@gmail.com wrote:
  Hello 2All,
 
  I have a problem in handling my ball using D-Pad control.
 
  Here is my code of handling a ball.
 
  public static final int DIRECTION_RIGHT = 0, DIRECTION_UP = 0,
  DIRECTION_DOWN = 0, DIRECTION_LEFT = 0;
  private int direction = 0;
  protected volatile boolean running = true;
  public boolean onKeyDown(int KeyCode, KeyEvent event){
  if(KeyCode==KeyEvent.KEYCODE_DPAD_CENTER){
 
  if(running == true){
 
  if(KeyCode == KeyEvent.KEYCODE_DPAD_RIGHT){
  setDirection(DIRECTION_RIGHT);
  }
  else if(KeyCode == KeyEvent.KEYCODE_DPAD_DOWN){
  setDirection(DIRECTION_DOWN);
  }
  else if(KeyCode == KeyEvent.KEYCODE_DPAD_LEFT){
  setDirection(DIRECTION_LEFT);
  }
  }
  }
  else {
  running = false;
  }
 
  return true;
  }
 
  public void setDirection(int direction) {
  this.direction = direction;
  }
 
  public int getDirection() {
  return direction;
  }

  --
 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.comandroid-developers%2bunsubscr...@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