[android-developers] GPS lat & long

2011-06-05 Thread ingy abbas
The GPS Latitude and longitude is not ( x and y Direction ) ?Is it z
direction ( slider some how )? When the map with overlay item appear
on the mobile it seems like the overlay items are Z direction Not
straight X and Y So is this True ?

-- 
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] Error on activity opnening

2011-05-30 Thread ingy abbas
When i click the next button it force close ;

enter code here
 05-30 23:46:21.595: VERBOSE/AudioHardwareMSM72XX(95): open driver
05-30 23:46:21.775: ERROR/AndroidRuntime(3401): FATAL
EXCEPTION: main
 05-30 23:46:21.775: ERROR/AndroidRuntime(3401):
java.lang.RuntimeException: Unable to start activity
ComponentInfo{yaraby.y/yaraby.y.yarab}: java.lang.NullPointerException
05-30 23:46:21.775: ERROR/AndroidRuntime(3401): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2669)
05-30 23:46:21.775: ERROR/AndroidRuntime(3401): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2685)
05-30 23:46:21.775: ERROR/AndroidRuntime(3401): at
android.app.ActivityThread.access$2300(ActivityThread.java:126)
05-30 23:46:21.775: ERROR/AndroidRuntime(3401): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2038)
 05-30 23:46:21.775: ERROR/AndroidRuntime(3401): at
android.os.Handler.dispatchMessage(Handler.java:99)
 05-30 23:46:21.775: ERROR/AndroidRuntime(3401): at
android.os.Looper.loop(Looper.java:123)
05-30 23:46:21.775: ERROR/AndroidRuntime(3401): at
android.app.ActivityThread.main(ActivityThread.java:4633)
05-30 23:46:21.775: ERROR/AndroidRuntime(3401): at
java.lang.reflect.Method.invokeNative(Native Method)
05-30 23:46:21.775: ERROR/AndroidRuntime(3401): at
java.lang.reflect.Method.invoke(Method.java:521)
  05-30 23:46:21.775: ERROR/AndroidRuntime(3401): at co
m.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:858)
  05-30 23:46:21.775: ERROR/AndroidRuntime(3401): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
  05-30 23:46:21.775: ERROR/AndroidRuntime(3401): at
dalvik.system.NativeStart.main(Native Method)
   05-30 23:46:21.775: ERROR/AndroidRuntime(3401): Caused by:
java.lang.NullPointerException
   05-30 23:46:21.775: ERROR/AndroidRuntime(3401): at
yaraby.y.yarab.onCreate(yarab.java:92)
   05-30 23:46:21.775: ERROR/AndroidRuntime(3401): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1047)
  05-30 23:46:21.775: ERROR/AndroidRuntime(3401): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2633)
  05-30 23:46:21.775: ERROR/AndroidRuntime(3401): ... 11 more

Yaraby code



enter code here
  public class yaraby extends Activity {
/** Called when the activity is first created. */
String sentence,sentence1, modifiedSentence;;
EditText inputfld, txt;
TextView Text;
Button Enter, Connect, next;
Socket clientSocket;

DataOutputStream outToServer;
BufferedReader inFromServer ;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
inputfld=(EditText)findViewById(R.id.input);
Text=(TextView)findViewById(R.id.view);
Enter=(Button)findViewById(R.id.enter);
Connect=(Button)findViewById(R.id.connect);
//yaraby x=new yaraby();
Text.append( "\n about to create a socket");


txt=(EditText)findViewById(R.id.txt);
next = (Button) findViewById(R.id.Button01);

next.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {
try{
Text.append("P");
Intent i = new Intent(yaraby.this, yarab.class);

startActivity(i);
Text.append("OPS");
}
catch(Error e){
Log.e("aa",
e.getMessage());
Text.append("ofa7ay");
}

}});

  }






public void appendText(View view){
Text.append( "\n  In chat ");

try{
//  while (true)
//{

sentence=inputfld.getText().toString();
sentence1="ing";
Text.append( "\n  DataStream creating");
outToServer.writeBytes(sentence);
outToServer.writeBytes(sentence1);
Thread.sleep(1000);
modifiedSentence = inFromServer.readLine();
Text.append(modifiedSentence);
inputfld.setText(null);
//if(modifiedSentence.equals("QUIT"))
//break;
   //   }
}
catch(Exception modifiedsentence){
Text.append("Exception");
}


}


public void connect(View view){
try{
clientSocket= new Socket("192.168.1.6",54611);
Text.append( "\n created a socket");
outToServer = new
DataOutputStream(clientSocket.getOutputStream());
Text.append( "\n created a datastream");
   

[android-developers] Re: android gps error on mobile when touch screen to send the lat and long

2011-05-29 Thread ingy abbas
Androiders any help please it is not hard

On May 29, 7:46 pm, ingy abbas  wrote:
> Here is the error i got when i run my android code contains two
> activities .
>
>      enter code here
>      05-29 19:23:42.131: ERROR/libgps(180): onUnsol: cmd 0x04 plen 57
>     05-29 19:23:42.131: ERROR/libgps(180): oem_unsol_gps_measurement:
> num_sv 3
>         05-29 19:23:42.131: ERROR/libgps(180):
> oem_unsol_gps_measurement: used_in_fix_mask 014E
>     05-29 19:23:42.384: WARN/ActivityManager(180): Activity destroy
> timeout for HistoryRecord{49f447f0 yaraby.y/.yarab}
>      05-29 19:23:43.136: ERROR/libgps(180): onUnsol: cmd 0x04 plen 57
>      05-29 19:23:43.136: ERROR/libgps(180): oem_unsol_gps_measurement:
> num_sv 3
>      05-29 19:23:43.136: ERROR/libgps(180): oem_unsol_gps_measurement:
> used_in_fix_mask 014E
>      05-29 19:23:44.136: ERROR/libgps(180): onUnsol: cmd 0x04 plen 57
>      05-29 19:23:44.136: ERROR/libgps(180): oem_unsol_gps_measurement:
> num_sv 3
>      05-29 19:23:44.136: ERROR/libgps(180): oem_unsol_gps_measurement:
> used_in_fix_mask 014E
>      05-29 19:23:45.131: ERROR/libgps(180): onUnsol: cmd 0x04 plen 57
>      05-29 19:23:45.131: ERROR/libgps(180): oem_unsol_gps_measurement:
> num_sv 3
>      05-29 19:23:45.131: ERROR/libgps(180): oem_unsol_gps_measurement:
> used_in_fix_mask 014E
>      05-29 19:23:46.135: ERROR/libgps(180): onUnsol: cmd 0x04 plen 57
>      05-29 19:23:46.135: ERROR/libgps(180): oem_unsol_gps_measurement:
> num_sv 3
>       05-29 19:23:46.135: ERROR/libgps(180):
> oem_unsol_gps_measurement: used_in_fix_mask 014E
>      05-29 19:23:47.136: ERROR/libgps(180): onUnsol: cmd 0x04 plen 57
>      05-29 19:23:47.136: ERROR/libgps(180): oem_unsol_gps_measurement:
> num_sv 3
>      05-29 19:23:47.136: ERROR/libgps(180): oem_unsol_gps_measurement:
> used_in_fix_mask 014E
>      05-29 19:23:48.131: ERROR/libgps(180): onUnsol: cmd 0x04 plen 57
>       05-29 19:23:48.131: ERROR/libgps(180):
> oem_unsol_gps_measurement: num_sv 3
>       05-29 19:23:48.131: ERROR/libgps(180):
> oem_unsol_gps_measurement: used_in_fix_mask 014E
>      05-29 19:23:49.135: ERROR/libgps(180): onUnsol: cmd 0x04 plen 57
>       05-29 19:23:49.135: ERROR/libgps(180):
> oem_unsol_gps_measurement: num_sv 3
>        05-29 19:23:49.135: ERROR/libgps(180):
> oem_unsol_gps_measurement: used_in_fix_mask 014E
>       05-29 19:23:50.135: ERROR/libgps(180): onUnsol: cmd 0x04 plen 57
>       05-29 19:23:50.135: ERROR/libgps(180):
> oem_unsol_gps_measurement: num_sv 3
>       05-29 19:23:50.135: ERROR/libgps(180):
> oem_unsol_gps_measurement: used_in_fix_mask 014E
>       05-29 19:23:51.131: ERROR/libgps(180): onUnsol: cmd 0x04 plen 57
>      05-29 19:23:51.131: ERROR/libgps(180): oem_unsol_gps_measurement:
> num_sv 3
>      05-29 19:23:51.131: ERROR/libgps(180): oem_unsol_gps_measurement:
> used_in_fix_mask 014E
>
> the code its a map view and contains button start so that when i click
> on it  its send the string data lat and long to my server
>
>     enter code here
>     package yaraby.y;
>
>         public class yarab extends MapActivity
>
>         {
>             Socket clientSocket;
>             TextView Text;
>                 private MapView mapView;
>                 private MapController mc;
>             DataOutputStream outToServer;
>             BufferedReader inFromServer ;
>              Button start;
>
>                  int error = 50;
>                 GeoPoint p, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12,
> p13,p14,p15,p16,p17,p18,p19,p20,p21,p22,p23,p24,p25,p26,p27,p28,p29;
>                 List mapOverlays;
>                 Drawable drawable, drawable2, drawable3, drawable4, drawable6,
> drawable7,
>                                 drawable8, drawable9, drawable10, drawable11, 
> drawable12,
>                                 drawable13, drawable5, drawable14, 
> drawable15, drawable16,
> drawable17, drawable18, drawable19, drawable20, drawable21,
> drawable22, drawable23, drawable24, drawable25, drawable26,
> drawable27, drawable28, drawable29;
>                 HelloItemizedOverlay itemizedOverlay, itemizedOverlay2,
> itemizedOverlay3,
>                                 itemizedOverlay4, itemizedOverlay5, 
> itemizedOverlay6,
>                                 itemizedOverlay7, itemizedOverlay8, 
> itemizedOverlay9,
>                                 itemizedOverlay10, itemizedOverlay11, 
> itemizedOverlay12,
>                                 itemizedOverlay13, itemizedOverlay14, 
> itemizedOverlay15,
> itemizedOverlay16, itemizedOverlay17, itemizedOverlay18,
> itemizedOverlay19, itemizedOverlay20, itemizedOverlay21,
> itemizedOverlay22, itemizedOverlay2

[android-developers] android gps error on mobile when touch screen to send the lat and long

2011-05-29 Thread ingy abbas
Here is the error i got when i run my android code contains two
activities .

 enter code here
 05-29 19:23:42.131: ERROR/libgps(180): onUnsol: cmd 0x04 plen 57
05-29 19:23:42.131: ERROR/libgps(180): oem_unsol_gps_measurement:
num_sv 3
05-29 19:23:42.131: ERROR/libgps(180):
oem_unsol_gps_measurement: used_in_fix_mask 014E
05-29 19:23:42.384: WARN/ActivityManager(180): Activity destroy
timeout for HistoryRecord{49f447f0 yaraby.y/.yarab}
 05-29 19:23:43.136: ERROR/libgps(180): onUnsol: cmd 0x04 plen 57
 05-29 19:23:43.136: ERROR/libgps(180): oem_unsol_gps_measurement:
num_sv 3
 05-29 19:23:43.136: ERROR/libgps(180): oem_unsol_gps_measurement:
used_in_fix_mask 014E
 05-29 19:23:44.136: ERROR/libgps(180): onUnsol: cmd 0x04 plen 57
 05-29 19:23:44.136: ERROR/libgps(180): oem_unsol_gps_measurement:
num_sv 3
 05-29 19:23:44.136: ERROR/libgps(180): oem_unsol_gps_measurement:
used_in_fix_mask 014E
 05-29 19:23:45.131: ERROR/libgps(180): onUnsol: cmd 0x04 plen 57
 05-29 19:23:45.131: ERROR/libgps(180): oem_unsol_gps_measurement:
num_sv 3
 05-29 19:23:45.131: ERROR/libgps(180): oem_unsol_gps_measurement:
used_in_fix_mask 014E
 05-29 19:23:46.135: ERROR/libgps(180): onUnsol: cmd 0x04 plen 57
 05-29 19:23:46.135: ERROR/libgps(180): oem_unsol_gps_measurement:
num_sv 3
  05-29 19:23:46.135: ERROR/libgps(180):
oem_unsol_gps_measurement: used_in_fix_mask 014E
 05-29 19:23:47.136: ERROR/libgps(180): onUnsol: cmd 0x04 plen 57
 05-29 19:23:47.136: ERROR/libgps(180): oem_unsol_gps_measurement:
num_sv 3
 05-29 19:23:47.136: ERROR/libgps(180): oem_unsol_gps_measurement:
used_in_fix_mask 014E
 05-29 19:23:48.131: ERROR/libgps(180): onUnsol: cmd 0x04 plen 57
  05-29 19:23:48.131: ERROR/libgps(180):
oem_unsol_gps_measurement: num_sv 3
  05-29 19:23:48.131: ERROR/libgps(180):
oem_unsol_gps_measurement: used_in_fix_mask 014E
 05-29 19:23:49.135: ERROR/libgps(180): onUnsol: cmd 0x04 plen 57
  05-29 19:23:49.135: ERROR/libgps(180):
oem_unsol_gps_measurement: num_sv 3
   05-29 19:23:49.135: ERROR/libgps(180):
oem_unsol_gps_measurement: used_in_fix_mask 014E
  05-29 19:23:50.135: ERROR/libgps(180): onUnsol: cmd 0x04 plen 57
  05-29 19:23:50.135: ERROR/libgps(180):
oem_unsol_gps_measurement: num_sv 3
  05-29 19:23:50.135: ERROR/libgps(180):
oem_unsol_gps_measurement: used_in_fix_mask 014E
  05-29 19:23:51.131: ERROR/libgps(180): onUnsol: cmd 0x04 plen 57
 05-29 19:23:51.131: ERROR/libgps(180): oem_unsol_gps_measurement:
num_sv 3
 05-29 19:23:51.131: ERROR/libgps(180): oem_unsol_gps_measurement:
used_in_fix_mask 014E

the code its a map view and contains button start so that when i click
on it  its send the string data lat and long to my server

enter code here
package yaraby.y;




public class yarab extends MapActivity

{
Socket clientSocket;
TextView Text;
private MapView mapView;
private MapController mc;
DataOutputStream outToServer;
BufferedReader inFromServer ;
 Button start;

 int error = 50;
GeoPoint p, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12,
p13,p14,p15,p16,p17,p18,p19,p20,p21,p22,p23,p24,p25,p26,p27,p28,p29;
List mapOverlays;
Drawable drawable, drawable2, drawable3, drawable4, drawable6,
drawable7,
drawable8, drawable9, drawable10, drawable11, 
drawable12,
drawable13, drawable5, drawable14, drawable15, 
drawable16,
drawable17, drawable18, drawable19, drawable20, drawable21,
drawable22, drawable23, drawable24, drawable25, drawable26,
drawable27, drawable28, drawable29;
HelloItemizedOverlay itemizedOverlay, itemizedOverlay2,
itemizedOverlay3,
itemizedOverlay4, itemizedOverlay5, 
itemizedOverlay6,
itemizedOverlay7, itemizedOverlay8, 
itemizedOverlay9,
itemizedOverlay10, itemizedOverlay11, 
itemizedOverlay12,
itemizedOverlay13, itemizedOverlay14, 
itemizedOverlay15,
itemizedOverlay16, itemizedOverlay17, itemizedOverlay18,
itemizedOverlay19, itemizedOverlay20, itemizedOverlay21,
itemizedOverlay22, itemizedOverlay23, itemizedOverlay24,
itemizedOverlay25, itemizedOverlay26, itemizedOverlay27,
itemizedOverlay28, itemizedOverlay29;
LocationManager locationManager;
Button next;
/** Called when the activity is first created. */

@Override
public void onCreate(Bundle savedInstanceState)

{
super.onCreate(savedInstanceState);

setContentView(R.layout.main2);

/* Use the LocationManager class to ob

[android-developers] Re: thread UI android Problems

2011-05-28 Thread ingy abbas
Dear Androiders no help ??

On May 28, 9:20 pm, ingy abbas  wrote:
> NO HELP IN THIS ???
>
> On May 28, 6:04 pm, ingy abbas  wrote:
>
>
>
>
>
>
>
> > here is an important question about thread UI , and please need help
> > in 
> > ithttp://stackoverflow.com/questions/6162756/thread-ui-problem-w-androi...

-- 
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] sending string of data from android to python

2011-05-28 Thread ingy abbas
What if i want to send this data to my socket Python  After i already
open a connection
and i want to send tis string


enter code here
 String Text = "My current location is: " +

"Latitud =" + loc.getLatitude()+

"Longitud =" +loc.getLongitude() ;

 so lat & long i want them to be send to my server python .,the
question is how after i already open socket

-- 
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] Re: thread UI android Problems

2011-05-28 Thread ingy abbas
NO HELP IN THIS ???

On May 28, 6:04 pm, ingy abbas  wrote:
> here is an important question about thread UI , and please need help
> in ithttp://stackoverflow.com/questions/6162756/thread-ui-problem-w-androi...

-- 
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] thread UI android Problems

2011-05-28 Thread ingy abbas
here is an important question about thread UI , and please need help
in it
http://stackoverflow.com/questions/6162756/thread-ui-problem-w-android-and-python-while-sending-data

-- 
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] Re: Error when i open socket and enter data to be send

2011-05-28 Thread ingy abbas

try{
Thread listen = new Thread(new
clientThread(clientSocket));
listen.start();
}catch(Exception e){}

What else i must add Its Urgent can u help please
On May 28, 1:32 am, Miguel Morales  wrote:
> Did you read the link I sent?  What have you tried?
>
>
>
>
>
>
>
>
>
> On Fri, May 27, 2011 at 3:18 PM, ingy abbas  wrote:
> > What i must add to this code
> >  public void appendText(View view){
> >        Text.append( "\n  In chat ");
>
> >        try{
> >    //  while (true)
> >        //{
>
> >        sentence=inputfld.getText().toString();
> >        sentence1="ing";
> >        Text.append( "\n  DataStream creating");
> >        outToServer.writeBytes(sentence);
> >        outToServer.writeBytes(sentence1);
> >        modifiedSentence = inFromServer.readLine();
> >        Text.append(modifiedSentence);
> >        inputfld.setText(null);
> >        //if(modifiedSentence.equals("QUIT"))
> >        //break;
> >   //   }
> >        }
> >        catch(Exception modifiedsentence){
> >                Text.append("Exception");
> >        }
>
> >    }
>
> >    public void connect(View view){
> >        try{
> >                clientSocket= new Socket("192.168.1.3",54637);
> >                Text.append( "\n created a socket");
> >                outToServer = new
> > DataOutputStream(clientSocket.getOutputStream());
> >                Text.append( "\n created a datastream");
> >                inFromServer = new BufferedReader(new
> > InputStreamReader(clientSocket.getInputStream()));
> >                Text.append( "\n created a bufferReader");
> >                outToServer = new
> > DataOutputStream(clientSocket.getOutputStream());
>
> >                try{
> >                Thread listen = new Thread(new
> > clientThread(clientSocket));
> >                listen.start();
> >            }catch(Exception e){}
>
> > //              Connect.setVisibility(1);
> > //              Text.append( "\n remove connect button");
> > //              Enter.setVisibility(0);
> >        }catch(Exception e){
> >                System.out.println("Error");
> >        }
> >    }
> > }
>
> > to solve the thread problem ??
>
> > On May 27, 10:56 pm, Miguel Morales  wrote:
> > > You need to read:
> >http://developer.android.com/resources/articles/painless-threading.html
>
> > > Also, put some more effort into your questions don't just dump some log
> > > text.
>
> > > On Fri, May 27, 2011 at 1:46 PM, ingy abbas 
> > wrote:
> > > > 05-27 23:34:12.933: INFO/ActivityThread(311): Pub
> > > > com.android.deskclock: com.android.deskclock.AlarmProvider
> > > > 05-27 23:40:10.814: ERROR/ActivityManager(61): ANR in yaraby.y
> > > > (yaraby.y/.yaraby)
> > > > 05-27 23:40:10.814: ERROR/ActivityManager(61): Reason:
> > > > keyDispatchingTimedOut
> > > > 05-27 23:40:10.814: ERROR/ActivityManager(61): Load: 0.17 / 1.97 /
> > > > 1.47
> > > > 05-27 23:40:10.814: ERROR/ActivityManager(61): CPU usage from 3844ms
> > > > to -1833ms ago:
> > > > 05-27 23:40:10.814: ERROR/ActivityManager(61):   20% 61/system_server:
> > > > 11% user + 8.6% kernel / faults: 366 minor 4 major
> > > > 05-27 23:40:10.814: ERROR/ActivityManager(61):   1% 126/zygote: 0.1%
> > > > user + 0.8% kernel / faults: 142 minor
> > > > 05-27 23:40:10.814: ERROR/ActivityManager(61):   1% 128/zygote: 0.3%
> > > > user + 0.7% kernel / faults: 107 minor
> > > > 05-27 23:40:10.814: ERROR/ActivityManager(61):   0% 415/yaraby.y: 0%
> > > > user + 0% kernel / faults: 80 minor 7 major
> > > > 05-27 23:40:10.814: ERROR/ActivityManager(61):   0.7% 40/adbd: 0% user
> > > > + 0.7% kernel
> > > > 05-27 23:40:10.814: ERROR/ActivityManager(61):   0% 13/kswapd0: 0%
> > > > user + 0% kernel
> > > > 05-27 23:40:10.814: ERROR/ActivityManager(61):   0.1% 37/qemud: 0%
> > > > user + 0.1% kernel
> > > > 05-27 23:40:10.814: ERROR/ActivityManager(61):   0% 425/logcat: 0%
> > > > user + 0% kernel
> > > > 05-27 23:40:10.814: ERROR/ActivityManager(61): 33% TOTAL: 16% user +
> > > > 16% kernel + 0.2% softirq
> > > > 05-27 23:40:10.814: ERROR/ActivityManager(61): CPU usage from 1100ms
> > > &g

[android-developers] Re: Error when i open socket and enter data to be send

2011-05-27 Thread ingy abbas
What i must add to this code
 public void appendText(View view){
Text.append( "\n  In chat ");

try{
//  while (true)
//{

sentence=inputfld.getText().toString();
sentence1="ing";
Text.append( "\n  DataStream creating");
outToServer.writeBytes(sentence);
outToServer.writeBytes(sentence1);
modifiedSentence = inFromServer.readLine();
Text.append(modifiedSentence);
inputfld.setText(null);
//if(modifiedSentence.equals("QUIT"))
//break;
   //   }
}
catch(Exception modifiedsentence){
Text.append("Exception");
}


}


public void connect(View view){
try{
clientSocket= new Socket("192.168.1.3",54637);
Text.append( "\n created a socket");
outToServer = new
DataOutputStream(clientSocket.getOutputStream());
Text.append( "\n created a datastream");
inFromServer = new BufferedReader(new
InputStreamReader(clientSocket.getInputStream()));
Text.append( "\n created a bufferReader");
outToServer = new
DataOutputStream(clientSocket.getOutputStream());

try{
Thread listen = new Thread(new
clientThread(clientSocket));
listen.start();
}catch(Exception e){}

//  Connect.setVisibility(1);
//  Text.append( "\n remove connect button");
//  Enter.setVisibility(0);
}catch(Exception e){
System.out.println("Error");
}
}
}



to solve the thread problem ??

On May 27, 10:56 pm, Miguel Morales  wrote:
> You need to 
> read:http://developer.android.com/resources/articles/painless-threading.html
>
> Also, put some more effort into your questions don't just dump some log
> text.
>
>
>
>
>
>
>
>
>
> On Fri, May 27, 2011 at 1:46 PM, ingy abbas  wrote:
> > 05-27 23:34:12.933: INFO/ActivityThread(311): Pub
> > com.android.deskclock: com.android.deskclock.AlarmProvider
> > 05-27 23:40:10.814: ERROR/ActivityManager(61): ANR in yaraby.y
> > (yaraby.y/.yaraby)
> > 05-27 23:40:10.814: ERROR/ActivityManager(61): Reason:
> > keyDispatchingTimedOut
> > 05-27 23:40:10.814: ERROR/ActivityManager(61): Load: 0.17 / 1.97 /
> > 1.47
> > 05-27 23:40:10.814: ERROR/ActivityManager(61): CPU usage from 3844ms
> > to -1833ms ago:
> > 05-27 23:40:10.814: ERROR/ActivityManager(61):   20% 61/system_server:
> > 11% user + 8.6% kernel / faults: 366 minor 4 major
> > 05-27 23:40:10.814: ERROR/ActivityManager(61):   1% 126/zygote: 0.1%
> > user + 0.8% kernel / faults: 142 minor
> > 05-27 23:40:10.814: ERROR/ActivityManager(61):   1% 128/zygote: 0.3%
> > user + 0.7% kernel / faults: 107 minor
> > 05-27 23:40:10.814: ERROR/ActivityManager(61):   0% 415/yaraby.y: 0%
> > user + 0% kernel / faults: 80 minor 7 major
> > 05-27 23:40:10.814: ERROR/ActivityManager(61):   0.7% 40/adbd: 0% user
> > + 0.7% kernel
> > 05-27 23:40:10.814: ERROR/ActivityManager(61):   0% 13/kswapd0: 0%
> > user + 0% kernel
> > 05-27 23:40:10.814: ERROR/ActivityManager(61):   0.1% 37/qemud: 0%
> > user + 0.1% kernel
> > 05-27 23:40:10.814: ERROR/ActivityManager(61):   0% 425/logcat: 0%
> > user + 0% kernel
> > 05-27 23:40:10.814: ERROR/ActivityManager(61): 33% TOTAL: 16% user +
> > 16% kernel + 0.2% softirq
> > 05-27 23:40:10.814: ERROR/ActivityManager(61): CPU usage from 1100ms
> > to 1759ms later:
> > 05-27 23:40:10.814: ERROR/ActivityManager(61):   16% 61/system_server:
> > 6.1% user + 10% kernel / faults: 12 minor
> > 05-27 23:40:10.814: ERROR/ActivityManager(61):     13% 92/
> > InputDispatcher: 6.1% user + 7.6% kernel
> > 05-27 23:40:10.814: ERROR/ActivityManager(61):     1.5% 62/HeapWorker:
> > 0% user + 1.5% kernel
> > 05-27 23:40:10.814: ERROR/ActivityManager(61):     1.5% 69/
> > SurfaceFlinger: 1.5% user + 0% kernel
> > 05-27 23:40:10.814: ERROR/ActivityManager(61): 38% TOTAL: 19% user +
> > 19% kernel
>
> > --
> > 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
>
> --
> ~ Jeremiah:9:23-24
> Android 2D MMORPG:http://solrpg.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.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Error when i open socket and enter data to be send

2011-05-27 Thread ingy abbas
05-27 23:34:12.933: INFO/ActivityThread(311): Pub
com.android.deskclock: com.android.deskclock.AlarmProvider
05-27 23:40:10.814: ERROR/ActivityManager(61): ANR in yaraby.y
(yaraby.y/.yaraby)
05-27 23:40:10.814: ERROR/ActivityManager(61): Reason:
keyDispatchingTimedOut
05-27 23:40:10.814: ERROR/ActivityManager(61): Load: 0.17 / 1.97 /
1.47
05-27 23:40:10.814: ERROR/ActivityManager(61): CPU usage from 3844ms
to -1833ms ago:
05-27 23:40:10.814: ERROR/ActivityManager(61):   20% 61/system_server:
11% user + 8.6% kernel / faults: 366 minor 4 major
05-27 23:40:10.814: ERROR/ActivityManager(61):   1% 126/zygote: 0.1%
user + 0.8% kernel / faults: 142 minor
05-27 23:40:10.814: ERROR/ActivityManager(61):   1% 128/zygote: 0.3%
user + 0.7% kernel / faults: 107 minor
05-27 23:40:10.814: ERROR/ActivityManager(61):   0% 415/yaraby.y: 0%
user + 0% kernel / faults: 80 minor 7 major
05-27 23:40:10.814: ERROR/ActivityManager(61):   0.7% 40/adbd: 0% user
+ 0.7% kernel
05-27 23:40:10.814: ERROR/ActivityManager(61):   0% 13/kswapd0: 0%
user + 0% kernel
05-27 23:40:10.814: ERROR/ActivityManager(61):   0.1% 37/qemud: 0%
user + 0.1% kernel
05-27 23:40:10.814: ERROR/ActivityManager(61):   0% 425/logcat: 0%
user + 0% kernel
05-27 23:40:10.814: ERROR/ActivityManager(61): 33% TOTAL: 16% user +
16% kernel + 0.2% softirq
05-27 23:40:10.814: ERROR/ActivityManager(61): CPU usage from 1100ms
to 1759ms later:
05-27 23:40:10.814: ERROR/ActivityManager(61):   16% 61/system_server:
6.1% user + 10% kernel / faults: 12 minor
05-27 23:40:10.814: ERROR/ActivityManager(61): 13% 92/
InputDispatcher: 6.1% user + 7.6% kernel
05-27 23:40:10.814: ERROR/ActivityManager(61): 1.5% 62/HeapWorker:
0% user + 1.5% kernel
05-27 23:40:10.814: ERROR/ActivityManager(61): 1.5% 69/
SurfaceFlinger: 1.5% user + 0% kernel
05-27 23:40:10.814: ERROR/ActivityManager(61): 38% TOTAL: 19% user +
19% kernel

-- 
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] Re: why cant send the string to the python server

2011-05-25 Thread ingy abbas
SO how to solve it !!

On May 25, 3:18 pm, Kostya Vasilyev  wrote:
> Don't run networking code on the UI thread.
>
> http://developer.android.com/guide/topics/fundamentals/processes-and-...
>
> -- Kostya
>
> 25.05.2011 17:12, ingy abbas пишет:
>
> > 05-25 15:10:04.049: ERROR/ActivityManager(175): ANR in Demo.Chat
> > (Demo.Chat/.Client)
>
> --
> Kostya Vasilyev --http://kmansoft.wordpress.com

-- 
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] Re: why cant send the string to the python server

2011-05-25 Thread ingy abbas
05-25 15:10:04.049: ERROR/ActivityManager(175): ANR in Demo.Chat
(Demo.Chat/.Client)
05-25 15:10:04.049: ERROR/ActivityManager(175): Reason:
keyDispatchingTimedOut
05-25 15:10:04.049: ERROR/ActivityManager(175): Load: 5.52 / 5.46 /
5.21
05-25 15:10:04.049: ERROR/ActivityManager(175): CPU usage from 12224ms
to 4054ms ago:
05-25 15:10:04.049: ERROR/ActivityManager(175):   system_server: 1% =
1% user + 0% kernel
05-25 15:10:04.049: ERROR/ActivityManager(175):   d.process.acore: 1%
= 1% user + 0% kernel / faults: 41 minor
05-25 15:10:04.049: ERROR/ActivityManager(175):   ksdioirqd/mmc1: 0% =
0% user + 0% kernel
05-25 15:10:04.049: ERROR/ActivityManager(175): TOTAL: 6% = 5% user +
0% kernel + 0% softirq


On May 25, 4:07 am, Kumar Bibek  wrote:
> Any errors on you logcat?
>
> Kumar Bibekhttp://techdroid.kbeanie.comhttp://www.kbeanie.com
>
>
>
>
>
>
>
> On Wed, May 25, 2011 at 4:42 AM, ingy abbas  wrote:
>
> > its create the socket between my android Mobile and my python server
> > but why its didnt send the cmd string  to the python ???!!
>
> >  public void connect(View view){
>
> >                            try {
> >                                String cmd=("My current location is: " );
> >                                clientSocket= new
> > Socket("192.168.1.2",54636);
> >                                Text.append( "\n created a socket");
> >                                outToServer = new
> > DataOutputStream(clientSocket.getOutputStream());
> >                                Text.append( "\n created a datastream");
> >                                inFromServer = new BufferedReader(new
> > InputStreamReader(clientSocket.getInputStream()));
> >                                Text.append( "\n created a bufferReader");
> >                               InetSocketAddress address1 = new
> > InetSocketAddress("192.168.1.2",54636);
> >                               Text.append( "\n created a socket");
> >                                DatagramPacket request = new
> > DatagramPacket(cmd.getBytes(), cmd.length(), address1);
>
> >                                DatagramSocket socket = new
> > DatagramSocket();
>
> >                                socket.send(request);
>
> >                            } catch (SocketException e) {
>
> >                                 e.printStackTrace();
> >                                }
>
> >        catch(Exception e){
> >                System.out.println("Error");
> >        }
> >    }
> >    }
>
> > --
> > 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


[android-developers] why cant send the string to the python server

2011-05-24 Thread ingy abbas

its create the socket between my android Mobile and my python server
but why its didnt send the cmd string  to the python ???!!



 public void connect(View view){




try {
String cmd=("My current location is: " );
clientSocket= new Socket("192.168.1.2",54636);
Text.append( "\n created a socket");
outToServer = new
DataOutputStream(clientSocket.getOutputStream());
Text.append( "\n created a datastream");
inFromServer = new BufferedReader(new
InputStreamReader(clientSocket.getInputStream()));
Text.append( "\n created a bufferReader");
   InetSocketAddress address1 = new
InetSocketAddress("192.168.1.2",54636);
   Text.append( "\n created a socket");
DatagramPacket request = new
DatagramPacket(cmd.getBytes(), cmd.length(), address1);

DatagramSocket socket = new DatagramSocket();

socket.send(request);

} catch (SocketException e) {

 e.printStackTrace();
}

catch(Exception e){
System.out.println("Error");
}
}
}

-- 
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] Socket on Android Mobile

2011-05-21 Thread ingy abbas
what if i want to connect my android mobile with my Pc server to be
able that my mobile to send my data ( my current location ) !! the
socket between mobile android and pc (SERVER) cant be happen any
suggestion ?? its only work when using the android emulator

-- 
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] Re: Connection between Android phone and python server suggestion

2011-05-17 Thread ingy abbas
 telnet
50.0.10.107 54639  and the 50.0.10.107 must be the pc IP and any port
right ???

On May 18, 1:00 am, Miguel Morales  wrote:
> I don't know what to tell you.  Go to another house, or an internet cafe and
> try the command there.  Like I said, my computer cannot connect, so it's a
> firewall/network issue.
>
>
>
>
>
>
>
> On Tue, May 17, 2011 at 3:59 PM, ingy abbas  wrote:
> > yup in computers it work but in mobile Not !! and its a huge problem
> > due to my project so do you have any suggestion
>
> > On May 18, 12:47 am, Miguel Morales  wrote:
> > > And you tried it from a different computer, right?  Not one in your
> > > house/office?
> > > It does not work from here.
>
> > > On Tue, May 17, 2011 at 3:45 PM, ingy abbas 
> > wrote:
> > > > its open microsoft  telnet command but the
> > > > 50.0.10.107 54639
> > > > Microsoft Telnet> 50.0.10.107 54639
> > > > Invalid Command. type ?/help for help
>
> > > > On May 18, 12:15 am, Miguel Morales  wrote:
> > > > > Make sure your port is open so that outside clients can connect to
> > that
> > > > > port.
> > > > > First, go to a computer outside your network and try to run: telnet
> > > > > 50.0.10.107 54639
>
> > > > > When that succeeds, you can continue.
>
> > > > > On Tue, May 17, 2011 at 3:12 PM, ingy abbas 
> > > > wrote:
> > > > > > so how can i make the server connect to the Mobile the code is
> > working
> > > > > > and connect on the emulator putting same port and localhost
>
> > > > > > On May 18, 12:08 am, Miguel Morales 
> > wrote:
> > > > > > > I can't seem to telnet using the following command: telnet
> > > > 50.0.10.107
> > > > > > 54639
>
> > > > > > > Make sure your server has that port open, perhaps it works in the
> > > > > > emulator
> > > > > > > because the emulator and server are on the same machine.
>
> > > > > > > On Tue, May 17, 2011 at 3:02 PM, ingy abbas <
> > ingy.abba...@gmail.com>
> > > > > > wrote:
> > > > > > > > package tryanabtry.opa;
>
> > > > > > > > import java.io.BufferedReader;
> > > > > > > > import java.io.DataOutputStream;
> > > > > > > > import java.io.IOException;
> > > > > > > > import java.io.InputStreamReader;
> > > > > > > > import java.net.DatagramPacket;
> > > > > > > > import java.net.DatagramSocket;
> > > > > > > > import java.net.InetSocketAddress;
> > > > > > > > import java.net.Socket;
> > > > > > > > import java.net.SocketException;
> > > > > > > > import java.util.List;
>
> > > > > > > > import android.app.PendingIntent;
> > > > > > > > import android.content.Context;
> > > > > > > > import android.content.res.Resources;
>
> > > > > > > > import android.graphics.Bitmap;
> > > > > > > > import android.graphics.BitmapFactory;
> > > > > > > > import android.graphics.Canvas;
> > > > > > > > import android.graphics.Point;
> > > > > > > > import android.graphics.drawable.Drawable;
> > > > > > > > import android.location.Location;
> > > > > > > > import android.location.LocationListener;
> > > > > > > > import android.location.LocationManager;
> > > > > > > > import android.os.Bundle;
> > > > > > > > import android.os.Handler;
> > > > > > > > import android.util.Log;
> > > > > > > > import android.view.View;
> > > > > > > > import android.widget.Button;
> > > > > > > > import android.widget.TextView;
> > > > > > > > import android.widget.Toast;
>
> > > > > > > > import com.google.android.maps.GeoPoint;
> > > > > > > > import com.google.android.maps.MapActivity;
> > > > > > > > import com.google.android.maps.MapController;
> > > > > > > > import com.google.android.maps.MapView;
> > > > > > > > import com.google.android.maps.Overlay;
> > > > > > > &

[android-developers] Re: Connection between Android phone and python server suggestion

2011-05-17 Thread ingy abbas
yup in computers it work but in mobile Not !! and its a huge problem
due to my project so do you have any suggestion

On May 18, 12:47 am, Miguel Morales  wrote:
> And you tried it from a different computer, right?  Not one in your
> house/office?
> It does not work from here.
>
>
>
>
>
>
>
> On Tue, May 17, 2011 at 3:45 PM, ingy abbas  wrote:
> > its open microsoft  telnet command but the
> > 50.0.10.107 54639
> > Microsoft Telnet> 50.0.10.107 54639
> > Invalid Command. type ?/help for help
>
> > On May 18, 12:15 am, Miguel Morales  wrote:
> > > Make sure your port is open so that outside clients can connect to that
> > > port.
> > > First, go to a computer outside your network and try to run: telnet
> > > 50.0.10.107 54639
>
> > > When that succeeds, you can continue.
>
> > > On Tue, May 17, 2011 at 3:12 PM, ingy abbas 
> > wrote:
> > > > so how can i make the server connect to the Mobile the code is working
> > > > and connect on the emulator putting same port and localhost
>
> > > > On May 18, 12:08 am, Miguel Morales  wrote:
> > > > > I can't seem to telnet using the following command: telnet
> > 50.0.10.107
> > > > 54639
>
> > > > > Make sure your server has that port open, perhaps it works in the
> > > > emulator
> > > > > because the emulator and server are on the same machine.
>
> > > > > On Tue, May 17, 2011 at 3:02 PM, ingy abbas 
> > > > wrote:
> > > > > > package tryanabtry.opa;
>
> > > > > > import java.io.BufferedReader;
> > > > > > import java.io.DataOutputStream;
> > > > > > import java.io.IOException;
> > > > > > import java.io.InputStreamReader;
> > > > > > import java.net.DatagramPacket;
> > > > > > import java.net.DatagramSocket;
> > > > > > import java.net.InetSocketAddress;
> > > > > > import java.net.Socket;
> > > > > > import java.net.SocketException;
> > > > > > import java.util.List;
>
> > > > > > import android.app.PendingIntent;
> > > > > > import android.content.Context;
> > > > > > import android.content.res.Resources;
>
> > > > > > import android.graphics.Bitmap;
> > > > > > import android.graphics.BitmapFactory;
> > > > > > import android.graphics.Canvas;
> > > > > > import android.graphics.Point;
> > > > > > import android.graphics.drawable.Drawable;
> > > > > > import android.location.Location;
> > > > > > import android.location.LocationListener;
> > > > > > import android.location.LocationManager;
> > > > > > import android.os.Bundle;
> > > > > > import android.os.Handler;
> > > > > > import android.util.Log;
> > > > > > import android.view.View;
> > > > > > import android.widget.Button;
> > > > > > import android.widget.TextView;
> > > > > > import android.widget.Toast;
>
> > > > > > import com.google.android.maps.GeoPoint;
> > > > > > import com.google.android.maps.MapActivity;
> > > > > > import com.google.android.maps.MapController;
> > > > > > import com.google.android.maps.MapView;
> > > > > > import com.google.android.maps.Overlay;
> > > > > > import com.google.android.maps.OverlayItem;
>
> > > > > > public class tryanabtry extends MapActivity
>
> > > > > > {
> > > > > >    Socket clientSocket;
> > > > > >    TextView Text;
> > > > > >        private MapView mapView;
> > > > > >        private MapController mc;
> > > > > >    DataOutputStream outToServer;
> > > > > >    BufferedReader inFromServer ;
>
> > > > > >        int error = 100;
> > > > > >        GeoPoint p, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12,
>
> > p13,p14,p15,p16,p17,p18,p19,p20,p21,p22,p23,p24,p25,p26,p27,p28,p29;
> > > > > >        List mapOverlays;
> > > > > >        Drawable drawable, drawable2, drawable3, drawable4,
> > drawable6,
> > > > > > drawable7,
> > > > > >                        drawable8, drawable9, drawable10,
> > drawable11,
> > > > > > drawable12,
> > > >

[android-developers] Re: Connection between Android phone and python server suggestion

2011-05-17 Thread ingy abbas
its open microsoft  telnet command but the
50.0.10.107 54639
Microsoft Telnet> 50.0.10.107 54639
Invalid Command. type ?/help for help

On May 18, 12:15 am, Miguel Morales  wrote:
> Make sure your port is open so that outside clients can connect to that
> port.
> First, go to a computer outside your network and try to run: telnet
> 50.0.10.107 54639
>
> When that succeeds, you can continue.
>
>
>
>
>
>
>
> On Tue, May 17, 2011 at 3:12 PM, ingy abbas  wrote:
> > so how can i make the server connect to the Mobile the code is working
> > and connect on the emulator putting same port and localhost
>
> > On May 18, 12:08 am, Miguel Morales  wrote:
> > > I can't seem to telnet using the following command: telnet 50.0.10.107
> > 54639
>
> > > Make sure your server has that port open, perhaps it works in the
> > emulator
> > > because the emulator and server are on the same machine.
>
> > > On Tue, May 17, 2011 at 3:02 PM, ingy abbas 
> > wrote:
> > > > package tryanabtry.opa;
>
> > > > import java.io.BufferedReader;
> > > > import java.io.DataOutputStream;
> > > > import java.io.IOException;
> > > > import java.io.InputStreamReader;
> > > > import java.net.DatagramPacket;
> > > > import java.net.DatagramSocket;
> > > > import java.net.InetSocketAddress;
> > > > import java.net.Socket;
> > > > import java.net.SocketException;
> > > > import java.util.List;
>
> > > > import android.app.PendingIntent;
> > > > import android.content.Context;
> > > > import android.content.res.Resources;
>
> > > > import android.graphics.Bitmap;
> > > > import android.graphics.BitmapFactory;
> > > > import android.graphics.Canvas;
> > > > import android.graphics.Point;
> > > > import android.graphics.drawable.Drawable;
> > > > import android.location.Location;
> > > > import android.location.LocationListener;
> > > > import android.location.LocationManager;
> > > > import android.os.Bundle;
> > > > import android.os.Handler;
> > > > import android.util.Log;
> > > > import android.view.View;
> > > > import android.widget.Button;
> > > > import android.widget.TextView;
> > > > import android.widget.Toast;
>
> > > > import com.google.android.maps.GeoPoint;
> > > > import com.google.android.maps.MapActivity;
> > > > import com.google.android.maps.MapController;
> > > > import com.google.android.maps.MapView;
> > > > import com.google.android.maps.Overlay;
> > > > import com.google.android.maps.OverlayItem;
>
> > > > public class tryanabtry extends MapActivity
>
> > > > {
> > > >    Socket clientSocket;
> > > >    TextView Text;
> > > >        private MapView mapView;
> > > >        private MapController mc;
> > > >    DataOutputStream outToServer;
> > > >    BufferedReader inFromServer ;
>
> > > >        int error = 100;
> > > >        GeoPoint p, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12,
> > > > p13,p14,p15,p16,p17,p18,p19,p20,p21,p22,p23,p24,p25,p26,p27,p28,p29;
> > > >        List mapOverlays;
> > > >        Drawable drawable, drawable2, drawable3, drawable4, drawable6,
> > > > drawable7,
> > > >                        drawable8, drawable9, drawable10, drawable11,
> > > > drawable12,
> > > >                        drawable13, drawable5, drawable14, drawable15,
> > > > drawable16,
> > > > drawable17, drawable18, drawable19, drawable20, drawable21,
> > > > drawable22, drawable23, drawable24, drawable25, drawable26,
> > > > drawable27, drawable28, drawable29;
> > > >        HelloItemizedOverlay itemizedOverlay, itemizedOverlay2,
> > > > itemizedOverlay3,
> > > >                        itemizedOverlay4, itemizedOverlay5,
> > > > itemizedOverlay6,
> > > >                        itemizedOverlay7, itemizedOverlay8,
> > > > itemizedOverlay9,
> > > >                        itemizedOverlay10, itemizedOverlay11,
> > > > itemizedOverlay12,
> > > >                        itemizedOverlay13, itemizedOverlay14,
> > > > itemizedOverlay15,
> > > > itemizedOverlay16, itemizedOverlay17, itemizedOverlay18,
> > > > itemizedOverlay19, itemizedOverlay20, itemizedOverlay21,
&g

[android-developers] Re: Connection between Android phone and python server suggestion

2011-05-17 Thread ingy abbas
so how can i make the server connect to the Mobile the code is working
and connect on the emulator putting same port and localhost

On May 18, 12:08 am, Miguel Morales  wrote:
> I can't seem to telnet using the following command: telnet 50.0.10.107 54639
>
> Make sure your server has that port open, perhaps it works in the emulator
> because the emulator and server are on the same machine.
>
>
>
>
>
>
>
> On Tue, May 17, 2011 at 3:02 PM, ingy abbas  wrote:
> > package tryanabtry.opa;
>
> > import java.io.BufferedReader;
> > import java.io.DataOutputStream;
> > import java.io.IOException;
> > import java.io.InputStreamReader;
> > import java.net.DatagramPacket;
> > import java.net.DatagramSocket;
> > import java.net.InetSocketAddress;
> > import java.net.Socket;
> > import java.net.SocketException;
> > import java.util.List;
>
> > import android.app.PendingIntent;
> > import android.content.Context;
> > import android.content.res.Resources;
>
> > import android.graphics.Bitmap;
> > import android.graphics.BitmapFactory;
> > import android.graphics.Canvas;
> > import android.graphics.Point;
> > import android.graphics.drawable.Drawable;
> > import android.location.Location;
> > import android.location.LocationListener;
> > import android.location.LocationManager;
> > import android.os.Bundle;
> > import android.os.Handler;
> > import android.util.Log;
> > import android.view.View;
> > import android.widget.Button;
> > import android.widget.TextView;
> > import android.widget.Toast;
>
> > import com.google.android.maps.GeoPoint;
> > import com.google.android.maps.MapActivity;
> > import com.google.android.maps.MapController;
> > import com.google.android.maps.MapView;
> > import com.google.android.maps.Overlay;
> > import com.google.android.maps.OverlayItem;
>
> > public class tryanabtry extends MapActivity
>
> > {
> >    Socket clientSocket;
> >    TextView Text;
> >        private MapView mapView;
> >        private MapController mc;
> >    DataOutputStream outToServer;
> >    BufferedReader inFromServer ;
>
> >        int error = 100;
> >        GeoPoint p, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12,
> > p13,p14,p15,p16,p17,p18,p19,p20,p21,p22,p23,p24,p25,p26,p27,p28,p29;
> >        List mapOverlays;
> >        Drawable drawable, drawable2, drawable3, drawable4, drawable6,
> > drawable7,
> >                        drawable8, drawable9, drawable10, drawable11,
> > drawable12,
> >                        drawable13, drawable5, drawable14, drawable15,
> > drawable16,
> > drawable17, drawable18, drawable19, drawable20, drawable21,
> > drawable22, drawable23, drawable24, drawable25, drawable26,
> > drawable27, drawable28, drawable29;
> >        HelloItemizedOverlay itemizedOverlay, itemizedOverlay2,
> > itemizedOverlay3,
> >                        itemizedOverlay4, itemizedOverlay5,
> > itemizedOverlay6,
> >                        itemizedOverlay7, itemizedOverlay8,
> > itemizedOverlay9,
> >                        itemizedOverlay10, itemizedOverlay11,
> > itemizedOverlay12,
> >                        itemizedOverlay13, itemizedOverlay14,
> > itemizedOverlay15,
> > itemizedOverlay16, itemizedOverlay17, itemizedOverlay18,
> > itemizedOverlay19, itemizedOverlay20, itemizedOverlay21,
> > itemizedOverlay22, itemizedOverlay23, itemizedOverlay24,
> > itemizedOverlay25, itemizedOverlay26, itemizedOverlay27,
> > itemizedOverlay28, itemizedOverlay29;
> >        LocationManager locationManager;
>
> >        /** Called when the activity is first created. */
>
> >        @Override
> >        public void onCreate(Bundle savedInstanceState)
>
> >        {
> >                try {
> >                        super.onCreate(savedInstanceState);
>
> >                        setContentView(R.layout.main);
>
> >                        /* Use the LocationManager class to obtain GPS
> > locations */
>
> >                        LocationManager mlocManager = (LocationManager)
> > getSystemService(Context.LOCATION_SERVICE);
>
> >                        LocationListener mlocListener = new
> > MyLocationListener();
>
> >  mlocManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0,
> >                                        0, mlocListener);
> >                        mapView = (MapView) findViewById(R.id.mapView);
>
> >                        // enable Street view by default
> >                        

[android-developers] Re: Connection between Android phone and python server suggestion

2011-05-17 Thread ingy abbas
import sys
from threading import Thread
import socket
import MySQLdb

allClients=[]

class Client(Thread):

def __init__(self,clientSocket):
Thread.__init__(self)
self.sockfd = clientSocket #socket client
self.name = ""
self.nickName = ""

def newClientConnect(self):

  allClients.append(self.sockfd)
  while True:


while True:

try:
 rm= self.sockfd.recv(2048)
 print rm
 i=0

 while (i<2):

if   (rm) == row[i][0]:
reply="\n Welcome to our game %s: %s"%
(rm,row[i][1])
self.sockfd.send(reply)
break

else:

i=i+1
if i==2:
reply="\n Error opaa ba2a"
self.sockfd.send(reply)
i=0
break
 break

except ValueError:
   self.sockfd.send("\n UNVAlied Comment ")


def run(self):
self.newClientConnect()
while True:
buff = self.sockfd.recv(2048)
if buff.strip() == 'quit':
 self.sockfd.close()
 break # Exit when break
else:
 self.sendAll(buff)
#Main
if __name__ == "__main__":

#Server Connection to socket:
IP = '50.0.10.107'
PORT = 5807
serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
serversocket.setsockopt( socket.SOL_SOCKET, socket.SO_REUSEADDR,
1 )
print ("Server Started")
try:
serversocket.bind(('',54633))
except ValueError,e:
print e
serversocket.listen(5)


db= MySQLdb.connect(host= "localhost",
  user="root",
  passwd="newpassword",
  db="new_schema")

cursor = db.cursor()

sql="""CREATE TABLE try (COL1 VARCHAR(45), COL2 VARCHAR(45), PRIMARY
KEY (COL1)) """
cursor.execute(sql)


#insert to table
cursor.execute("""INSERT INTO try VALUES (%s,%s)""",("opa","myghost"))
db.commit()
#db.rollback()
#show table
#cursor.execute("""SELECT * FROM try""")
print cursor.fetchall()
db.close()




print "Connected to the Database"

while True:
(clientSocket, address) = serversocket.accept()
print 'New connection from ', address
ct = Client(clientSocket)
ct.start()




__all__ = ['allClients','Client']

-- 
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] Re: Connection between Android phone and python server suggestion

2011-05-17 Thread ingy abbas
rrent location is: " +

"Latitud =" + loc.getLatitude()*1E11+

"Longitud =" +loc.getLongitude()*1E11);
try {
InetSocketAddress address = new
InetSocketAddress("50.0.10.107",54639);
DatagramPacket request = new 
DatagramPacket(cmd.getBytes(),
cmd.length(), address);
DatagramSocket socket = new DatagramSocket();
socket.send(request);
} catch (SocketException e) {

  System.out.print("");
}
 catch (IOException e) {

   System.out.print("SSS");
}



String Text = "My current location is: " +

"Latitud =" + loc.getLatitude()+

"Longitud =" +loc.getLongitude() ;// loc.getLongitude() 
; //
loc.getLatitude()+"anoog" + (p3.getLatitudeE6() - error)

Toast.makeText(getApplicationContext(),

Text,

Toast.LENGTH_SHORT).show();

mc.animateTo(point);

if ((p3.getLatitudeE6() - error)<= (loc.getLatitude() * 
1E6) &&
(loc.getLatitude() * 1E6)<= (p3.getLatitudeE6() + error)) {
mapView.getOverlays().remove(itemizedOverlay3);
mapView.invalidate();

}

// /if (point ==p){
// /mapView.getOverlays().remove(p);
//  }
// mapView.getOverlays().remove(p);
}


private Resources getResources() {
// TODO Auto-generated method stub
return null;
}


public void onProviderDisabled(String provider)

{

Toast.makeText(getApplicationContext(),

"Gps Disabled",

Toast.LENGTH_SHORT).show();

}

public void onProviderEnabled(String provider)

{

Toast.makeText(getApplicationContext(),

"Gps Enabled",

Toast.LENGTH_SHORT).show();

}

public void onStatusChanged(String provider, int status, Bundle
extras)

{

}

protected boolean isRouteDisplayed() {
return false;
}

}/* End of Class MyLocationListener */

@Override
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
}

}

/* End of UseGps Activity */

On 17 مايو, 23:45, Miguel Morales  wrote:
> Just post the code to pastebin and show it here.
> The more eyes, the better.
>
>
>
>
>
>
>
>
>
> On Tue, May 17, 2011 at 2:27 PM, ingy abbas  wrote:
> > Sure becaue i;m using wifi so it open a web page
>
> > On 17 مايو, 23:21, Tobiah  wrote:
> > > On 05/17/2011 02:14 PM, ingy abbas wrote:
>
> > > > This what i did and it connect only when i'm using the android
> > > > emulator but when i use the mobile it did not connect !!any help in
> > > > this
>
> > > Can you browse the web on the mobile?
>
> > --
> > 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
>
> --
> ~ Jeremiah:9:23-24
> Android 2D MMORPG:http://solrpg.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.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Connection between Android phone and python server suggestion

2011-05-17 Thread ingy abbas
Sure becaue i;m using wifi so it open a web page

On 17 مايو, 23:21, Tobiah  wrote:
> On 05/17/2011 02:14 PM, ingy abbas wrote:
>
> > This what i did and it connect only when i'm using the android
> > emulator but when i use the mobile it did not connect !!any help in
> > this
>
> Can you browse the web on the mobile?

-- 
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] Re: Connection between Android phone and python server suggestion

2011-05-17 Thread ingy abbas
post here or any one let me send to his mail to check it up to me its
really important and i will appreciate that

On 17 مايو, 23:15, Miguel Morales  wrote:
> You should post your socket code, or provide more information.
>
>
>
>
>
>
>
>
>
> On Tue, May 17, 2011 at 2:14 PM, ingy abbas  wrote:
> > This what i did and it connect only when i'm using the android
> > emulator but when i use the mobile it did not connect !!any help in
> > this
>
> > On 17 مايو, 22:42, Nicholas Johnson  wrote:
> > > Put the IP address of the server you're trying to connect to.
>
> > --
> > 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
>
> --
> ~ Jeremiah:9:23-24
> Android 2D MMORPG:http://solrpg.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.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Connection between Android phone and python server suggestion

2011-05-17 Thread ingy abbas
This what i did and it connect only when i'm using the android
emulator but when i use the mobile it did not connect !!any help in
this

On 17 مايو, 22:42, Nicholas Johnson  wrote:
> Put the IP address of the server you're trying to connect to.

-- 
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] Re: Connection between Android phone and python server suggestion

2011-05-17 Thread ingy abbas
what about socket ..it is  not connected What ip address i
must put ?!!!

On 17 مايو, 19:16, Nicholas Johnson  wrote:
> Yes, it can be done. You can exchange data between a server and an Android
> app in any way that you want. I prefer encoding the communication/data in a
> JSON object.
>
> Nick

-- 
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] Connection between Android phone and python server suggestion

2011-05-17 Thread ingy abbas
how can i connect a server code python on PC with android mobile so
that i be able to then and receive data between the server and the
android mobile ?? but put in consider that the socket can not be open
on the mobile android despite its open on the emulator and connect

NOTE ::>>i want my Android mobile to send to the server my current
location the lat and long method appear to me (GPS) my current
location i want this string method to be send to the server

-- 
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] Connection between Android phone and python server

2011-05-16 Thread ingy abbas
I want to be able to send  Messages Between Android phone and Python
Server so to be able to send my lat and lang in GPS appear on my
Android mobile phone . because i cant open socket on my android mobile
and i want to be able to send lat and lang (GPS ) from my android
mobile to my Server Python and i cant open socket using the phone;
socket can be open only when i use Emulator .. So tany solution !! or
suggestion to solve the problem?

-- 
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] send lat and long using open socket

2011-05-15 Thread ingy abbas
I want to send this Lat and Long the gps current location on my open
socket between my android and my python server .

enter code here
public void onLocationChanged(Location loc)

{

GeoPoint point = new GeoPoint((int) (loc.getLatitude() * 1E6),
(int) (loc.getLongitude() * 1E6));


String Text = "My current location is: " +

"Latitud =" + loc.getLatitude()+

"Longitud =" +loc.getLongitude() ;
Toast.makeText(getApplicationContext(),

Text,

Toast.LENGTH_SHORT).show();
so i save it on string text and i add button to connect it to the
server now i want to send the lat and lang each time so how to send
this string using the open socket ??

-- 
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] Android Connect to python and send current location

2011-05-15 Thread ingy abbas
I want to connect android code with is Map View code with my python
code (server ) so i want when i touch the screen or i want to make
button when i click to it the android send to the server using the gps
i do Send my current location to server SO can i add buttons appear in
my map and be action listener or when touch the map it send the
location i created a socket in my map view code i added this method


 public void connect(View view){
try{
clientSocket= new Socket("10.0.2.2",54633);
Text.append( "\n created a socket");
outToServer = new
DataOutputStream(clientSocket.getOutputStream());
Text.append( "\n created a datastream");
inFromServer = new BufferedReader(new
InputStreamReader(clientSocket.getInputStream()));
   ;
   }catch(Exception e){
System.out.println("Error");
   }
   }
So i want to add action listener when i click on map and be able to
send my current location

-- 
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] Re: Adding overlay items between two overlay items

2011-05-14 Thread ingy abbas
can i take the average of the lat of both overlay item location then
add them then divide by 2 then the point will appear between them !!

On May 14, 10:04 pm, TreKing  wrote:
> On Sat, May 14, 2011 at 2:40 PM, ingy abbas  wrote:
> > I want to play a pacman real life game so i want to be able to eat
> > the overlay points ( vitamin ) now i need the normal points !! so
> > this normal points i want them to be added betweeen vitamin
> > points electronics (automatically ) wizout getting every location and
> > enter the point manually
>
> I have no idea what you're talking about.
>
> But if you're saying you have
>
> @                         @
>
> on a map and you want:
>
> @ - - - - - - - - - - - - @
>
> Then all you need is another itemized overlay with the "-" image with enough
> items to draw the dashes, which you would add exactly as you have already
> added the first two points.
>
> --- 
> --
> 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.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Adding overlay items between two overlay items

2011-05-14 Thread ingy abbas
I want to play a pacman real life game so i want to be able to eat the
overlay points ( vitamin ) now i need the normal points !! so this
normal points i want them to be added betweeen vitamin points
electronics (automatically ) wizout getting every location and enter
the point manually

On May 14, 9:31 pm, TreKing  wrote:
> On Sat, May 14, 2011 at 2:26 PM, ingy abbas  wrote:
> > If I Want it like this  @ > the 2 over lay items added and i want to add
> > other overlay items between them !!
>
> 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.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Adding overlay items between two overlay items

2011-05-14 Thread ingy abbas
What if i added two over lay items  on same line and i want to add
overlay items between them in the map Can this be done
If I Want it like this  @ > the 2 over lay items added and i want to
add other overlay items between them !! can this be done ??
@ .. @

-- 
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] add overlay at my current location

2011-05-12 Thread ingy abbas
Here is my code !! i want to add overlay item in my current
location !! but  seems a problem i cant can any one check what i have
to add to my code
package tryanabtry.opa;


import java.util.List;





import android.app.PendingIntent;
import android.content.Context;
import android.content.res.Resources;


import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Point;
import android.graphics.drawable.Drawable;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.widget.TextView;
import android.widget.Toast;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;
import com.google.android.maps.Overlay;
import com.google.android.maps.OverlayItem;


public class tryanabtry extends MapActivity

{
private MapView mapView;
private MapController mc;

int error=100;
GeoPoint p, p2, p3, p4,p5,p6,p7,p8,p9,p10,p11,p12,p13;
List mapOverlays;
Drawable drawable, drawable2 , drawable3,
drawable4,drawable6,drawable7,drawable8,drawable9,drawable10,drawable11,drawable12,drawable13,drawable5;
HelloItemizedOverlay itemizedOverlay, itemizedOverlay2 ,
itemizedOverlay3,
itemizedOverlay4,itemizedOverlay5,itemizedOverlay6,itemizedOverlay7,itemizedOverlay8,itemizedOverlay9,itemizedOverlay10,itemizedOverlay11,itemizedOverlay12,itemizedOverlay13;

/** Called when the activity is first created. */

@Override

public void onCreate(Bundle savedInstanceState)

{
try{
super.onCreate(savedInstanceState);

setContentView(R.layout.main);


/* Use the LocationManager class to obtain GPS locations */

LocationManager mlocManager =
(LocationManager)getSystemService(Context.LOCATION_SERVICE);

LocationListener mlocListener = new MyLocationListener();

mlocManager.requestLocationUpdates( LocationManager.GPS_PROVIDER, 0,
0, mlocListener);
mapView = (MapView) findViewById(R.id.mapView);

// enable Street view by default
mapView.setStreetView(true);

// enable to show Satellite view
mapView.setSatellite(true);

// enable to show Traffic on map
// mapView.setTraffic(true);
mapView.setBuiltInZoomControls(true);

mc = mapView.getController();
//mapView.setStreetView(true);
//mapView.setSatellite(true);
mc.setZoom(12);
addOverLays();
}
catch(Exception e){
Log.d("e",e.getMessage());
}

}
///lat2=29.98763859272003;
//log2 = 31.44235074520111
public void addOverLays(){
String [] coordinates =
{"31.216487288475037","29.932637214660645" ,"30.084123015403748",
"51.5002" , "-0.1262","31.337149143218994"};
   double lat = 29.98739718380868,lat2
=29.98763859272003,lat3=29.987574219703674,lat4=29.98718498160553;
double log = 31.442527770886084, log2 =
31.44235074520111,log3=31.44225418567575,log4=31.442527770996094;

p = new GeoPoint((int) (lat * 1E6), (int) (log * 1E6));
p2 = new GeoPoint( (int) (lat2 * 1e6), (int) (log2 * 1e6));
p3=new GeoPoint( (int) (lat3 * 1e6), (int) (log3 * 1e6));
p4=new GeoPoint( (int) (lat4 * 1e6), (int) (log4 * 1e6));
p5=new GeoPoint( (int) ((lat3+lat2)/2 * 1e6), (int) (log3 * 1e6));
p6=new GeoPoint( (int) ((lat3+lat4)/2 * 1e6), (int) (log3 * 1e6));
p7=new GeoPoint( (int) ((lat3+lat)/2 * 1e6), (int) (log3 * 1e6));
p8=new GeoPoint( (int) ((lat+lat2)/2 * 1e6), (int) (log3 * 1e6));
p9=new GeoPoint( (int) ((lat2+lat4)/2 * 1e6), (int) (log3 * 1e6));
 //   p10=new GeoPoint( (int) ((lat+lat3)/2 * 1e6), (int) (log3 *
1e6));
//p11=new GeoPoint( (int) ((lat3+lat2)/2 * 1e6), (int) (log3 *
1e6));

//  Location loc = null;
 //p4 = new GeoPoint((int) (loc.getLatitude() * 1E6),
   //   (int) (loc.getLongitude() * 1E6));
//p3=new GeoPoint( (int) (lat3 * 1e6), (int) (log3 * 1e6));
mapOverlays = mapView.getOverlays();
drawable = this.getResources().getDrawable(R.drawable.vitblue);
drawable2 = this.getResources().getDrawable(R.drawable.ballon);
drawable3 =
this.getResources().getDrawable(R.drawable.blacka);
drawable4 = this.getResources().getDrawable(R.drawable.vitblue);


itemizedOverlay = new HelloItemizedOverlay(drawable,this);
itemizedOverlay2 = new
HelloItemizedOverlay(drawable2,this);
itemizedOverlay3 = new HelloItemizedOverlay(drawable3,this);
itemizedOverlay4 = new HelloItemizedOverlay(drawable4,this);


OverlayItem overlayitem = new OverlayItem(p, "Cairo", " over1");
   OverlayItem over2 = new OverlayItem(p2, "ulm", "over2");
  OverlayItem over3 = new OverlayItem(p3, "o", "over3");
   OverlayItem over4 = new OverlayItem(p4, "o", "over4");


itemizedOverlay.addOverlay(overlayitem);

mapOverlays.add(itemizedOverlay);

itemizedOverlay2.addOverlay(over2);
   mapOverlays.add(itemizedOverlay

[android-developers] error opening 2 activities

2011-05-12 Thread ingy abbas
05-12 23:26:07.041: ERROR/AndroidRuntime(5170): Uncaught handler:
thread main exiting due to uncaught exception
05-12 23:26:07.051: ERROR/AndroidRuntime(5170): java.lang.VerifyError:
yaraby.y.yaraby$1
05-12 23:26:07.051: ERROR/AndroidRuntime(5170): at
yaraby.y.yaraby.onCreate(yaraby.java:44)
05-12 23:26:07.051: ERROR/AndroidRuntime(5170): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1127)
05-12 23:26:07.051: ERROR/AndroidRuntime(5170): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2231)
05-12 23:26:07.051: ERROR/AndroidRuntime(5170): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2284)
05-12 23:26:07.051: ERROR/AndroidRuntime(5170): at
android.app.ActivityThread.access$1800(ActivityThread.java:112)
05-12 23:26:07.051: ERROR/AndroidRuntime(5170): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
05-12 23:26:07.051: ERROR/AndroidRuntime(5170): at
android.os.Handler.dispatchMessage(Handler.java:99)
05-12 23:26:07.051: ERROR/AndroidRuntime(5170): at
android.os.Looper.loop(Looper.java:123)
05-12 23:26:07.051: ERROR/AndroidRuntime(5170): at
android.app.ActivityThread.main(ActivityThread.java:3948)
05-12 23:26:07.051: ERROR/AndroidRuntime(5170): at
java.lang.reflect.Method.invokeNative(Native Method)
05-12 23:26:07.051: ERROR/AndroidRuntime(5170): at
java.lang.reflect.Method.invoke(Method.java:521)
05-12 23:26:07.051: ERROR/AndroidRuntime(5170): at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:782)
 05-12 23:26:07.051: ERROR/AndroidRuntime(5170): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
 05-12 23:26:07.051: ERROR/AndroidRuntime(5170): at
dalvik.system.NativeStart.main(Native Method)





 Public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
inputfld=(EditText)findViewById(R.id.input);
Text=(TextView)findViewById(R.id.view);
Enter=(Button)findViewById(R.id.enter);
Connect=(Button)findViewById(R.id.connect);

Text.append( "\n about to create a socket");


txt=(EditText)findViewById(R.id.txt);
next = (Button) findViewById(R.id.Button01);

next.setOnClickListener(new OnClickListener() {   this is line
44
@Override
public void onClick(View v) {
Intent i = new Intent(yaraby.this,
HelloItemizedOverlay.class);
 yaraby.this.startActivity(i);
//  Toast.makeText(getApplicationContext(),
"haaa",Toast.LENGTH_LONG).show();
}
});

-- 
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] Re: Mapactivity second intent

2011-05-11 Thread ingy abbas
ye !!

On May 11, 2:39 am, TreKing  wrote:
> On Tue, May 10, 2011 at 6:48 PM, ingy abbas  wrote:
> > *05-11 02:46:19.843: ERROR/AndroidRuntime(311):
> > java.lang.NoClassDefFoundError: yaraby.y.Mapy*
>
> Did you include the class in you manifest?
>
> --- 
> --
> 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.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Adding points automatic

2011-05-10 Thread ingy abbas
Using googlemaps How to add small points or dashes "---" between
two overlay items on the googlemaps to be added electronics not as
overlay added manually i can add a path but i want to add - or
points electronics please help

-- 
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] Re: Mapactivity second intent

2011-05-10 Thread ingy abbas
Done and the first activity work well i make a button to make me view
the next  activity but it forse close Due to this errors
05-11 02:46:19.823: ERROR/AndroidRuntime(311): Uncaught handler:
thread main exiting due to uncaught exception
05-11 02:46:19.843: ERROR/AndroidRuntime(311):
java.lang.NoClassDefFoundError: yaraby.y.Mapy
05-11 02:46:19.843: ERROR/AndroidRuntime(311): at yaraby.y.yaraby
$1.onClick(yaraby.java:51)
05-11 02:46:19.843: ERROR/AndroidRuntime(311): at
android.view.View.performClick(View.java:2364)
05-11 02:46:19.843: ERROR/AndroidRuntime(311): at
android.view.View.onTouchEvent(View.java:4179)
05-11 02:46:19.843: ERROR/AndroidRuntime(311): at
android.widget.TextView.onTouchEvent(TextView.java:6534)
05-11 02:46:19.843: ERROR/AndroidRuntime(311): at
android.view.View.dispatchTouchEvent(View.java:3709)
05-11 02:46:19.843: ERROR/AndroidRuntime(311): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:883)
05-11 02:46:19.843: ERROR/AndroidRuntime(311): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:883)
05-11 02:46:19.843: ERROR/AndroidRuntime(311): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:883)
05-11 02:46:19.843: ERROR/AndroidRuntime(311): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:883)
05-11 02:46:19.843: ERROR/AndroidRuntime(311): at
com.android.internal.policy.impl.PhoneWindow
$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)
05-11 02:46:19.843: ERROR/AndroidRuntime(311): at
com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:
1107)
05-11 02:46:19.843: ERROR/AndroidRuntime(311): at
android.app.Activity.dispatchTouchEvent(Activity.java:2061)
05-11 02:46:19.843: ERROR/AndroidRuntime(311): at
com.android.internal.policy.impl.PhoneWindow
$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)
05-11 02:46:19.843: ERROR/AndroidRuntime(311): at
android.view.ViewRoot.handleMessage(ViewRoot.java:1691)
05-11 02:46:19.843: ERROR/AndroidRuntime(311): at
android.os.Handler.dispatchMessage(Handler.java:99)
05-11 02:46:19.843: ERROR/AndroidRuntime(311): at
android.os.Looper.loop(Looper.java:123)
05-11 02:46:19.843: ERROR/AndroidRuntime(311): at
android.app.ActivityThread.main(ActivityThread.java:4338)
05-11 02:46:19.843: ERROR/AndroidRuntime(311): at
java.lang.reflect.Method.invokeNative(Native Method)
05-11 02:46:19.843: ERROR/AndroidRuntime(311): at
java.lang.reflect.Method.invoke(Method.java:521)
05-11 02:46:19.843: ERROR/AndroidRuntime(311): at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:860)
05-11 02:46:19.843: ERROR/AndroidRuntime(311): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
05-11 02:46:19.843: ERROR/AndroidRuntime(311): at
dalvik.system.NativeStart.main(Native Method)


On 11 مايو, 00:34, TreKing  wrote:
> Please respond to the group.
>
> On Tue, May 10, 2011 at 5:32 PM, ingy abbas  wrote:
> > Can i open the first activity normal activty then the second
> > activity MapsActivity??
>
> Yes - you could have figured this out by just trying it ...
>
> --- 
> --
> 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.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Mapactivity second intent

2011-05-10 Thread ingy abbas
If i have an activity open socket between my client Android and python
then i want  to go to other activity intent which is MapActivity by
clicking on Button ... So is it acceptable to open the second as
Mapactivity ?!! any help

-- 
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] Re: Removing a specific over lay item

2011-04-29 Thread ingy abbas
Please i need help its  urgent any  help

On 29 April 2011 20:29, ingy abbas  wrote:

> how can i remove a specific over lay item if my GPS current location
> is the same as the point location ?!

-- 
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] Removing a specific over lay item

2011-04-29 Thread ingy abbas
how can i remove a specific over lay item if my GPS current location
is the same as the point location ?!

-- 
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] 1e6 *lat and 1000000*;*lat errors

2011-04-24 Thread ingy abbas
   i want to add the  third over lay item so i use this but it doesnt
work what shall i do when i cant use 1e6 and 1E6 any more and 100
force close and i want to add the third overlay item and other
((p3=new GeoPoint( (int) (lat3 * 100), (int) (log3 * 100

-- 
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] if i want to add overlay item to appear in map & also the gps point

2011-04-22 Thread ingy abbas
package ntryn.n;


import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;
import com.google.android.maps.MapController;
import com.google.android.maps.GeoPoint;


import android.content.Context;

import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;

import android.location.Geocoder;
import android.location.Address;

import com.google.android.maps.Overlay;
import android.graphics.Canvas;
import android.graphics.Point;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.Drawable;

import java.util.List;
import java.util.Locale;
import java.io.IOException;




import android.os.Bundle;
import android.widget.Toast;

public class ntryn extends MapActivity {
private MapView mapView;
private MapController mapController;

private LocationManager locationManager;
private LocationListener locationListener;
List mapOverlays;
Drawable drawable, drawable2 ;
HelloItemizedOverlay itemizedoverlay;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

locationManager = (LocationManager)
getSystemService(Context.LOCATION_SERVICE);

locationListener = new GPSLocationListener();

locationManager.requestLocationUpdates(
LocationManager.GPS_PROVIDER,
0,
0,
locationListener);

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

// enable Street view by default
mapView.setStreetView(true);

// enable to show Satellite view
// mapView.setSatellite(true);

// enable to show Traffic on map
// mapView.setTraffic(true);
mapView.setBuiltInZoomControls(true);

mapController = mapView.getController();
mapController.setZoom(16);

mapController = mapView.getController();

mapView.invalidate();

GeoPoint p;
String coordinates[] = {"30.084691643714909",
"31.335958242416382"};
double lat = Double.parseDouble(coordinates[0]);
double lng = Double.parseDouble(coordinates[1]);

p = new GeoPoint(
(int) (lat * 1E6),
(int) (lng * 1E6));

mapController.animateTo(p);
mapController.setZoom(17);

  //  HelloItemizedOverlay itemizedoverlay = new
HelloItemizedOverlay(drawable);
MapOverlay mapOverlay = new MapOverlay();
List listOfOverlays = mapView.getOverlays();
listOfOverlays.clear();
listOfOverlays.add(mapOverlay);

mapView.invalidate();
}


@Override
protected boolean isRouteDisplayed() {
return false;
}

private class GPSLocationListener implements LocationListener
{
public void onLocationChanged(Location location) {
if (location != null) {
GeoPoint point = new GeoPoint(
(int) (location.getLatitude() * 1E6),
(int) (location.getLongitude() * 1E6));

/* Toast.makeText(getBaseContext(),
"Latitude: " + location.getLatitude() +
" Longitude: " + location.getLongitude(),
Toast.LENGTH_SHORT).show();*/

mapController.animateTo(point);
mapController.setZoom(16);

   // GeoPoint point1 = new
GeoPoint{"30.084691643714909,31.335958242416382"};

// add marker
MapOverlay mapOverlay = new MapOverlay();
mapOverlay.setPointToDraw(point);
List listOfOverlays = mapView.getOverlays();
listOfOverlays.clear();
listOfOverlays.add(mapOverlay);

String address = ConvertPointToLocation(point);
Toast.makeText(getBaseContext(), address,
Toast.LENGTH_SHORT).show();

mapView.invalidate();
}
}

public String ConvertPointToLocation(GeoPoint point) {
String address = "";
Geocoder geoCoder = new Geocoder(
getBaseContext(), Locale.getDefault());
try {
List addresses = geoCoder.getFromLocation(
point.getLatitudeE6()  / 1E6,
point.getLongitudeE6() / 1E6, 1);

if (addresses.size() > 0) {
for (int index = 0; index <
addresses.get(0).getMaxAddressLineIndex(); index++)
address +=
addresses.get(0).getAddressLine(index) + " ";
}
}
catch (IOException e) {
e.printStackTrace();
}

return address;
}

public void onProviderDisabled(String provider) {
}

public void onProviderEnabled(String provider) {
}

public void onStatusChanged(String prov

[android-developers] google api 1.5

2011-04-20 Thread ingy abbas
I want to install google api 1.5 on my sdk i'm using eclipse note that
its not in my available packages to be install !!!

-- 
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] Android simulator and telnet

2011-04-11 Thread ingy abbas

, Hey i'm just trying to connect android simulator via telnet to be
apply to use gps location
and i try to run it then write telnet in the console but i cant not
write in the console any suggestion what to do  .. thank in advance

-- 
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] Android simulator and telnet

2011-04-11 Thread ingy abbas

, Hey i'm just trying to connect android simulator via telnet to be
apply to use gps location
and i try to run it then write telnet in the console but i cant not
write in the console any suggestion what to do  .. thank in advance

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