[android-developers] cookie management under webviews

2013-06-21 Thread BearTi


Hi,

when I´m set 180 Cookies in my WebView, these 180 cookies are saved and can be 
displayd again. When I´m create 181 Cookies, just 150 are stored (Number 
32-181). Now when I set 181 Cookies, just 151 are stored and so on...

Why is this so? Is it a bug or what are the maximum values for cookies 
respectively how many cookies can be stored?

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: uploaded file on Google drive , bbut onActivityResult returnd 0

2013-06-21 Thread Ana
*Hi Martin,

Thanks for correcting me , this is a test application, so didn't bother abt 
hard coded values. it isuploading file.

My problem is that i am using a intent to uploada file, but i want to 
perform some action once file is successfully uploaded . can you help me to 
find out the solution.
 i spend some time but only way which i found is to listen notification 
using accessibilityEvent.but no luck :(
*
On Friday, June 21, 2013 9:43:56 AM UTC+5:30, Martin Krischik wrote:


 Am Donnerstag, 20. Juni 2013 10:59:19 UTC+2 schrieb Ana:

 Log.i(LOG_TAG, serviceUpload start);
 Uri pdfUri = Uri.parse(file://storage/emulated/0/myfile.txt);


 Hardcoded URL? To the root of the sdcard? And only two forward slashes 
 after «file:»?

 Does not get more wrong!

 You should use android.content.Context.getExternalFilesDir and convert the 
 result the proper way. There is a function to convert path names to URI. I 
 forgot the name — google it yourself.

 Martin



-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Socket Programing

2013-06-21 Thread Ibrahim Sada
Hi Friends I Want To Connect Server As Pc And Client As Android
device(emulator)
After connecting i want to sends and recive mesgs from eachothers..
I Am not able to do so..
Please Help me put friends please
Thanks...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
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Updating APK that supports 3.0+ only

2013-06-21 Thread TreKing
On Thu, Jun 20, 2013 at 11:35 AM, Darren McEntee
darren.mcen...@gmail.comwrote:

 My question is, when i upload the new APK to my Google Play account, where
 the app is currently listed:

 (1) Will the current users of the app who are on Androd v2.1 - v2.3 just
 not get the updates from that point onwards until they update their Android
 OS version?


To my understanding, correct. They see no updates. I've seen the behavior
myself. I have a 2.3 phone and have many apps that show having been updated
recently, but that device received no such update.


 (2) Will **NEW** users of the app running Android v2.1 to v2.3 not see
 the app listed on Play if they search for it?


To my understanding, yes, they will see the last published version that
supported their device.

And (3) can i have an APK for user of 2.3.x and *below* ... and the *another
 *APK for users on v3.0+?


Yes, see Multiple APK support. However, it's probably a better idea to
try to support every version you want to target in one APK using reflection
and other such strategies.

-
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
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Socket Programing

2013-06-21 Thread Kristopher Micinski
You should just be able to use any Java sockets tutorial, that isn't
the hard part,

Kris

On Fri, Jun 21, 2013 at 6:53 AM, Ibrahim Sada ibrahim.in...@gmail.com wrote:
 Hi Friends I Want To Connect Server As Pc And Client As Android
 device(emulator)
 After connecting i want to sends and recive mesgs from eachothers..
 I Am not able to do so..
 Please Help me put friends please
 Thanks...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
 ---
 You received this message because you are subscribed to the Google Groups
 Android Developers group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.



-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Socket Programing

2013-06-21 Thread Ibrahim Sada
I used bro..i can do java server client properly..bt i cant do server as
java and android as client
i cant do yaar

On 21 June 2013 17:36, Kristopher Micinski krismicin...@gmail.com wrote:

 You should just be able to use any Java sockets tutorial, that isn't
 the hard part,

 Kris

 On Fri, Jun 21, 2013 at 6:53 AM, Ibrahim Sada ibrahim.in...@gmail.com
 wrote:
  Hi Friends I Want To Connect Server As Pc And Client As Android
  device(emulator)
  After connecting i want to sends and recive mesgs from eachothers..
  I Am not able to do so..
  Please Help me put friends please
  Thanks...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
  ---
  You received this message because you are subscribed to the Google Groups
  Android Developers group.
  To unsubscribe from this group and stop receiving emails from it, send an
  email to android-developers+unsubscr...@googlegroups.com.
  For more options, visit https://groups.google.com/groups/opt_out.
 
 

 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Updating APK that supports 3.0+ only

2013-06-21 Thread Darren McEntee
Thanks for the update TreKing, 

So:
 

 (2) Will **NEW** users of the app running Android v2.1 to v2.3 not see 
 the app listed on Play if they search for it?


 To my understanding, yes, they will see the last published version that 
 supported their device.


Ah ok, so this might work. If the older Android users get offered the 
latest version of my app *that their device supports*, and new android 
users get the newer version of the app, then this still accounts for all 
Android users.
Can any confirm this? Or how can i get Google to confirm this?

Thanks a lot!
Darren.

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Socket Programing

2013-06-21 Thread Kristopher Micinski
Please talk in more understandable English :-),

What specifically are you having trouble with? There's no special
function you have to call on Android that makes things magically
work.

Kris

On Fri, Jun 21, 2013 at 8:18 AM, Ibrahim Sada ibrahim.in...@gmail.com wrote:
 I used bro..i can do java server client properly..bt i cant do server as
 java and android as client
 i cant do yaar


 On 21 June 2013 17:36, Kristopher Micinski krismicin...@gmail.com wrote:

 You should just be able to use any Java sockets tutorial, that isn't
 the hard part,

 Kris

 On Fri, Jun 21, 2013 at 6:53 AM, Ibrahim Sada ibrahim.in...@gmail.com
 wrote:
  Hi Friends I Want To Connect Server As Pc And Client As Android
  device(emulator)
  After connecting i want to sends and recive mesgs from eachothers..
  I Am not able to do so..
  Please Help me put friends please
  Thanks...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
  ---
  You received this message because you are subscribed to the Google
  Groups
  Android Developers group.
  To unsubscribe from this group and stop receiving emails from it, send
  an
  email to android-developers+unsubscr...@googlegroups.com.
  For more options, visit https://groups.google.com/groups/opt_out.
 
 

 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.



 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.



-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] uploaded file on Google drive , bbut onActivityResult returnd 0

2013-06-21 Thread TreKing
On Thu, Jun 20, 2013 at 3:59 AM, Ana anamika.k...@gmail.com wrote:

 i have tried below code to upload a txt file in gDrive successfully , but
 i m getting 0 in onActivityResult


Is it documented that the Google Drive app returns a result or are you just
assuming this and hoping for the best?

-
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
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Socket Programing

2013-06-21 Thread Ibrahim Sada
if u want i can send u my code...

On 21 June 2013 17:58, Kristopher Micinski krismicin...@gmail.com wrote:

 Please talk in more understandable English :-),

 What specifically are you having trouble with? There's no special
 function you have to call on Android that makes things magically
 work.

 Kris

 On Fri, Jun 21, 2013 at 8:18 AM, Ibrahim Sada ibrahim.in...@gmail.com
 wrote:
  I used bro..i can do java server client properly..bt i cant do server as
  java and android as client
  i cant do yaar
 
 
  On 21 June 2013 17:36, Kristopher Micinski krismicin...@gmail.com
 wrote:
 
  You should just be able to use any Java sockets tutorial, that isn't
  the hard part,
 
  Kris
 
  On Fri, Jun 21, 2013 at 6:53 AM, Ibrahim Sada ibrahim.in...@gmail.com
  wrote:
   Hi Friends I Want To Connect Server As Pc And Client As Android
   device(emulator)
   After connecting i want to sends and recive mesgs from eachothers..
   I Am not able to do so..
   Please Help me put friends please
   Thanks...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
   ---
   You received this message because you are subscribed to the Google
   Groups
   Android Developers group.
   To unsubscribe from this group and stop receiving emails from it, send
   an
   email to android-developers+unsubscr...@googlegroups.com.
   For more options, visit https://groups.google.com/groups/opt_out.
  
  
 
  --
  --
  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 unsubscribe from this group and stop receiving emails from it, send
 an
  email to android-developers+unsubscr...@googlegroups.com.
  For more options, visit https://groups.google.com/groups/opt_out.
 
 
 
  --
  --
  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 unsubscribe from this group and stop receiving emails from it, send an
  email to android-developers+unsubscr...@googlegroups.com.
  For more options, visit https://groups.google.com/groups/opt_out.
 
 

 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Socket Programing

2013-06-21 Thread Ibrahim Sada
package com.in2em.clientactivity;

import java.io.BufferedWriter;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.net.InetAddress;
import java.net.Socket;

import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class ClientActivity extends Activity {
/** Called when the activity is first created. */
 private EditText serverIp;

private Button connectPhones;

private String serverIpAddress = 192.168.1.27;

private boolean connected = false;

private Handler handler = new Handler();

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.client);

   // serverIp = (EditText) findViewById(R.id.server_ip);
connectPhones = (Button) findViewById(R.id.connect_phones);

connectPhones.setOnClickListener((android.view.View.OnClickListener)
connectListener);
}

private OnClickListener connectListener = new OnClickListener() {

@Override
public void onClick(View v) {
if (!connected) {
  //  serverIpAddress = serverIp.getText().toString();
  //  if (!serverIpAddress.equals()) {
Thread cThread = new Thread(new ClientThread());
cThread.start();
   // }
}
}
};

public class ClientThread implements Runnable {

public void run() {
try {
InetAddress serverAddr =
InetAddress.getByName(serverIpAddress);
Log.d(ClientActivity, C: Connecting...);
Socket socket = new Socket(serverAddr, );

while (connected) {

try {
Log.d(ClientActivity, C: Sending command.);
PrintWriter out = new PrintWriter(new
BufferedWriter(new OutputStreamWriter(socket
.getOutputStream())), true);
// where you issue the commands
out.println(Hey Server!);
Log.d(ClientActivity, C: Sent.);
} catch (Exception e) {
Log.e(ClientActivity, S: Error, e);
}
}
socket.close();
Log.d(ClientActivity, C: Closed.);
} catch (Exception e) {
Log.e(ClientActivity, C: Error, e);
connected = false;
}
}
}
}

On 21 June 2013 18:15, Ibrahim Sada ibrahim.in...@gmail.com wrote:

 if u want i can send u my code...


 On 21 June 2013 17:58, Kristopher Micinski krismicin...@gmail.com wrote:

 Please talk in more understandable English :-),

 What specifically are you having trouble with? There's no special
 function you have to call on Android that makes things magically
 work.

 Kris

 On Fri, Jun 21, 2013 at 8:18 AM, Ibrahim Sada ibrahim.in...@gmail.com
 wrote:
  I used bro..i can do java server client properly..bt i cant do server as
  java and android as client
  i cant do yaar
 
 
  On 21 June 2013 17:36, Kristopher Micinski krismicin...@gmail.com
 wrote:
 
  You should just be able to use any Java sockets tutorial, that isn't
  the hard part,
 
  Kris
 
  On Fri, Jun 21, 2013 at 6:53 AM, Ibrahim Sada ibrahim.in...@gmail.com
 
  wrote:
   Hi Friends I Want To Connect Server As Pc And Client As Android
   device(emulator)
   After connecting i want to sends and recive mesgs from eachothers..
   I Am not able to do so..
   Please Help me put friends please
   Thanks...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
   ---
   You received this message because you are subscribed to the Google
   Groups
   Android Developers group.
   To unsubscribe from this group and stop receiving emails from it,
 send
   an
   email to android-developers+unsubscr...@googlegroups.com.
   For more options, visit https://groups.google.com/groups/opt_out.
  
  
 
  --
  --
  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
  

Re: [android-developers] Socket Programing

2013-06-21 Thread Ibrahim Sada
Please friend check my code..

On 21 June 2013 18:16, Ibrahim Sada ibrahim.in...@gmail.com wrote:

 package com.in2em.server;

 import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.io.PrintStream;
 import java.net.InetAddress;
 import java.net.ServerSocket;
 import java.net.Socket;

 public class Server {
 public static void main(String[] args) {

 try {
 // First we create a server socket and bind it to port .
 ServerSocket myServerSocket = new ServerSocket();


 // wait for an incoming connection...
 System.out.println(Server is waiting for an incoming
 connection on host=
 + InetAddress.getLocalHost().getCanonicalHostName()
 +  port= + myServerSocket.getLocalPort());
 Socket skt = myServerSocket.accept();

 // ok, got a connection.  Let's use java.io.* niceties to read
 and write from the connection.
 BufferedReader myInput = new BufferedReader(new
 InputStreamReader(skt.getInputStream()));
 PrintStream myOutput = new
 PrintStream(skt.getOutputStream());

 // attempt to read input from the stream.
 String buf = myInput.readLine();

 // if we got input, print it out and write a message back to
 the remote client..
 if (buf != null) {
 System.out.println(Server read: [ + buf + ]);
 myOutput.print(got it);
 }

 // close the connection.
 skt.close();
 System.out.println(Server is exiting);

 } catch (IOException ex) {
 ex.printStackTrace();
 System.out.println(Whoops, something bad happened!  I'm outta
 here.);

 }



 }

 }


 On 21 June 2013 18:16, Ibrahim Sada ibrahim.in...@gmail.com wrote:

 package com.in2em.clientactivity;

 import java.io.BufferedWriter;
 import java.io.OutputStreamWriter;
 import java.io.PrintWriter;
 import java.net.InetAddress;
 import java.net.Socket;

 import android.app.Activity;
 import android.os.Bundle;
 import android.os.Handler;
 import android.util.Log;
 import android.view.View;
 import android.view.View.OnClickListener;
 import android.widget.Button;
 import android.widget.EditText;

 public class ClientActivity extends Activity {
 /** Called when the activity is first created. */
  private EditText serverIp;

 private Button connectPhones;

 private String serverIpAddress = 192.168.1.27;

 private boolean connected = false;

 private Handler handler = new Handler();

 @Override
 protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.client);

// serverIp = (EditText) findViewById(R.id.server_ip);
 connectPhones = (Button) findViewById(R.id.connect_phones);

 connectPhones.setOnClickListener((android.view.View.OnClickListener)
 connectListener);
 }

 private OnClickListener connectListener = new OnClickListener() {

 @Override
 public void onClick(View v) {
 if (!connected) {
   //  serverIpAddress = serverIp.getText().toString();
   //  if (!serverIpAddress.equals()) {
 Thread cThread = new Thread(new ClientThread());
 cThread.start();
// }
 }
 }
 };

 public class ClientThread implements Runnable {

 public void run() {
 try {
 InetAddress serverAddr =
 InetAddress.getByName(serverIpAddress);
 Log.d(ClientActivity, C: Connecting...);
 Socket socket = new Socket(serverAddr, );

 while (connected) {

 try {
 Log.d(ClientActivity, C: Sending
 command.);
 PrintWriter out = new PrintWriter(new
 BufferedWriter(new OutputStreamWriter(socket
 .getOutputStream())), true);
 // where you issue the commands
 out.println(Hey Server!);
 Log.d(ClientActivity, C: Sent.);
 } catch (Exception e) {
 Log.e(ClientActivity, S: Error, e);
 }
 }
 socket.close();
 Log.d(ClientActivity, C: Closed.);
 } catch (Exception e) {
 Log.e(ClientActivity, C: Error, e);
 connected = false;

 }
 }
 }
 }

 On 21 June 2013 18:15, Ibrahim Sada ibrahim.in...@gmail.com wrote:

 if u want i can send u my code...


 On 21 June 2013 

Re: [android-developers] Socket Programing

2013-06-21 Thread Ibrahim Sada
package com.in2em.server;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;

public class Server {
public static void main(String[] args) {

try {
// First we create a server socket and bind it to port .
ServerSocket myServerSocket = new ServerSocket();


// wait for an incoming connection...
System.out.println(Server is waiting for an incoming
connection on host=
+ InetAddress.getLocalHost().getCanonicalHostName()
+  port= + myServerSocket.getLocalPort());
Socket skt = myServerSocket.accept();

// ok, got a connection.  Let's use java.io.* niceties to read
and write from the connection.
BufferedReader myInput = new BufferedReader(new
InputStreamReader(skt.getInputStream()));
PrintStream myOutput = new PrintStream(skt.getOutputStream());

// attempt to read input from the stream.
String buf = myInput.readLine();

// if we got input, print it out and write a message back to
the remote client..
if (buf != null) {
System.out.println(Server read: [ + buf + ]);
myOutput.print(got it);
}

// close the connection.
skt.close();
System.out.println(Server is exiting);

} catch (IOException ex) {
ex.printStackTrace();
System.out.println(Whoops, something bad happened!  I'm outta
here.);
}



}

}


On 21 June 2013 18:16, Ibrahim Sada ibrahim.in...@gmail.com wrote:

 package com.in2em.clientactivity;

 import java.io.BufferedWriter;
 import java.io.OutputStreamWriter;
 import java.io.PrintWriter;
 import java.net.InetAddress;
 import java.net.Socket;

 import android.app.Activity;
 import android.os.Bundle;
 import android.os.Handler;
 import android.util.Log;
 import android.view.View;
 import android.view.View.OnClickListener;
 import android.widget.Button;
 import android.widget.EditText;

 public class ClientActivity extends Activity {
 /** Called when the activity is first created. */
  private EditText serverIp;

 private Button connectPhones;

 private String serverIpAddress = 192.168.1.27;

 private boolean connected = false;

 private Handler handler = new Handler();

 @Override
 protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.client);

// serverIp = (EditText) findViewById(R.id.server_ip);
 connectPhones = (Button) findViewById(R.id.connect_phones);

 connectPhones.setOnClickListener((android.view.View.OnClickListener)
 connectListener);
 }

 private OnClickListener connectListener = new OnClickListener() {

 @Override
 public void onClick(View v) {
 if (!connected) {
   //  serverIpAddress = serverIp.getText().toString();
   //  if (!serverIpAddress.equals()) {
 Thread cThread = new Thread(new ClientThread());
 cThread.start();
// }
 }
 }
 };

 public class ClientThread implements Runnable {

 public void run() {
 try {
 InetAddress serverAddr =
 InetAddress.getByName(serverIpAddress);
 Log.d(ClientActivity, C: Connecting...);
 Socket socket = new Socket(serverAddr, );

 while (connected) {

 try {
 Log.d(ClientActivity, C: Sending command.);
 PrintWriter out = new PrintWriter(new
 BufferedWriter(new OutputStreamWriter(socket
 .getOutputStream())), true);
 // where you issue the commands
 out.println(Hey Server!);
 Log.d(ClientActivity, C: Sent.);
 } catch (Exception e) {
 Log.e(ClientActivity, S: Error, e);
 }
 }
 socket.close();
 Log.d(ClientActivity, C: Closed.);
 } catch (Exception e) {
 Log.e(ClientActivity, C: Error, e);
 connected = false;

 }
 }
 }
 }

 On 21 June 2013 18:15, Ibrahim Sada ibrahim.in...@gmail.com wrote:

 if u want i can send u my code...


 On 21 June 2013 17:58, Kristopher Micinski krismicin...@gmail.comwrote:

 Please talk in more understandable English :-),

 What specifically are you having 

Re: [android-developers] Updating APK that supports 3.0+ only

2013-06-21 Thread TreKing
On Fri, Jun 21, 2013 at 7:21 AM, Darren McEntee darren.mcen...@gmail.comwrote:

 Or how can i get Google to confirm this?


That's a good one. It's nice to start the day off with a good laugh,
thanks. You'll have better luck pulling the back tooth out of a jaguar than
getting specific answers about the Play store from Google.

Look here
http://developer.android.com/google/play/dist.html
http://developer.android.com/distribute/googleplay/publish/index.html
https://support.google.com/googleplay/android-developer/

-
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
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Socket Programing

2013-06-21 Thread Kristopher Micinski
Nobody here is going to check your code, why don't you debug it
yourself and show some effort that you actually tried to diagnose the
problem: perhaps by debugging and stepping through your code.  Then
when you find out what might be wrong report back and people can give
some advice.

Nodbody is going to reproduce your code because:
  - it takes a long time to do
  - they don't know what you're talking about when you say it doesn't work
  - they find it disrespectful that you're treating them like a
ragdoll TA who will fix anything
  - they have no idea where to look for problems,

Kris

On Fri, Jun 21, 2013 at 8:47 AM, Ibrahim Sada ibrahim.in...@gmail.com wrote:
 Please friend check my code..


 On 21 June 2013 18:16, Ibrahim Sada ibrahim.in...@gmail.com wrote:

 package com.in2em.server;

 import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.io.PrintStream;
 import java.net.InetAddress;
 import java.net.ServerSocket;
 import java.net.Socket;

 public class Server {
 public static void main(String[] args) {

 try {
 // First we create a server socket and bind it to port .
 ServerSocket myServerSocket = new ServerSocket();


 // wait for an incoming connection...
 System.out.println(Server is waiting for an incoming
 connection on host=
 + InetAddress.getLocalHost().getCanonicalHostName()
 +  port= + myServerSocket.getLocalPort());
 Socket skt = myServerSocket.accept();

 // ok, got a connection.  Let's use java.io.* niceties to read
 and write from the connection.
 BufferedReader myInput = new BufferedReader(new
 InputStreamReader(skt.getInputStream()));
 PrintStream myOutput = new PrintStream(skt.getOutputStream());

 // attempt to read input from the stream.
 String buf = myInput.readLine();

 // if we got input, print it out and write a message back to
 the remote client..
 if (buf != null) {
 System.out.println(Server read: [ + buf + ]);
 myOutput.print(got it);
 }

 // close the connection.
 skt.close();
 System.out.println(Server is exiting);

 } catch (IOException ex) {
 ex.printStackTrace();
 System.out.println(Whoops, something bad happened!  I'm outta
 here.);

 }



 }

 }


 On 21 June 2013 18:16, Ibrahim Sada ibrahim.in...@gmail.com wrote:

 package com.in2em.clientactivity;

 import java.io.BufferedWriter;
 import java.io.OutputStreamWriter;
 import java.io.PrintWriter;
 import java.net.InetAddress;
 import java.net.Socket;

 import android.app.Activity;
 import android.os.Bundle;
 import android.os.Handler;
 import android.util.Log;
 import android.view.View;
 import android.view.View.OnClickListener;
 import android.widget.Button;
 import android.widget.EditText;

 public class ClientActivity extends Activity {
 /** Called when the activity is first created. */
  private EditText serverIp;

 private Button connectPhones;

 private String serverIpAddress = 192.168.1.27;

 private boolean connected = false;

 private Handler handler = new Handler();

 @Override
 protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.client);

// serverIp = (EditText) findViewById(R.id.server_ip);
 connectPhones = (Button) findViewById(R.id.connect_phones);

 connectPhones.setOnClickListener((android.view.View.OnClickListener)
 connectListener);
 }

 private OnClickListener connectListener = new OnClickListener() {

 @Override
 public void onClick(View v) {
 if (!connected) {
   //  serverIpAddress = serverIp.getText().toString();
   //  if (!serverIpAddress.equals()) {
 Thread cThread = new Thread(new ClientThread());
 cThread.start();
// }
 }
 }
 };

 public class ClientThread implements Runnable {

 public void run() {
 try {
 InetAddress serverAddr =
 InetAddress.getByName(serverIpAddress);
 Log.d(ClientActivity, C: Connecting...);
 Socket socket = new Socket(serverAddr, );

 while (connected) {

 try {
 Log.d(ClientActivity, C: Sending
 command.);
 PrintWriter out = new PrintWriter(new
 BufferedWriter(new OutputStreamWriter(socket
 .getOutputStream())), true);
 // where you issue the commands

Re: [android-developers] Socket Programing

2013-06-21 Thread Ibrahim Sada
thanks Friend...i will keep ur words...

On 21 June 2013 18:55, Kristopher Micinski krismicin...@gmail.com wrote:

 Nobody here is going to check your code, why don't you debug it
 yourself and show some effort that you actually tried to diagnose the
 problem: perhaps by debugging and stepping through your code.  Then
 when you find out what might be wrong report back and people can give
 some advice.

 Nodbody is going to reproduce your code because:
   - it takes a long time to do
   - they don't know what you're talking about when you say it doesn't work
   - they find it disrespectful that you're treating them like a
 ragdoll TA who will fix anything
   - they have no idea where to look for problems,

 Kris

 On Fri, Jun 21, 2013 at 8:47 AM, Ibrahim Sada ibrahim.in...@gmail.com
 wrote:
  Please friend check my code..
 
 
  On 21 June 2013 18:16, Ibrahim Sada ibrahim.in...@gmail.com wrote:
 
  package com.in2em.server;
 
  import java.io.BufferedReader;
  import java.io.IOException;
  import java.io.InputStreamReader;
  import java.io.PrintStream;
  import java.net.InetAddress;
  import java.net.ServerSocket;
  import java.net.Socket;
 
  public class Server {
  public static void main(String[] args) {
 
  try {
  // First we create a server socket and bind it to port .
  ServerSocket myServerSocket = new ServerSocket();
 
 
  // wait for an incoming connection...
  System.out.println(Server is waiting for an incoming
  connection on host=
  + InetAddress.getLocalHost().getCanonicalHostName()
  +  port= + myServerSocket.getLocalPort());
  Socket skt = myServerSocket.accept();
 
  // ok, got a connection.  Let's use java.io.* niceties to
 read
  and write from the connection.
  BufferedReader myInput = new BufferedReader(new
  InputStreamReader(skt.getInputStream()));
  PrintStream myOutput = new
 PrintStream(skt.getOutputStream());
 
  // attempt to read input from the stream.
  String buf = myInput.readLine();
 
  // if we got input, print it out and write a message back to
  the remote client..
  if (buf != null) {
  System.out.println(Server read: [ + buf + ]);
  myOutput.print(got it);
  }
 
  // close the connection.
  skt.close();
  System.out.println(Server is exiting);
 
  } catch (IOException ex) {
  ex.printStackTrace();
  System.out.println(Whoops, something bad happened!  I'm
 outta
  here.);
 
  }
 
 
 
  }
 
  }
 
 
  On 21 June 2013 18:16, Ibrahim Sada ibrahim.in...@gmail.com wrote:
 
  package com.in2em.clientactivity;
 
  import java.io.BufferedWriter;
  import java.io.OutputStreamWriter;
  import java.io.PrintWriter;
  import java.net.InetAddress;
  import java.net.Socket;
 
  import android.app.Activity;
  import android.os.Bundle;
  import android.os.Handler;
  import android.util.Log;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.widget.Button;
  import android.widget.EditText;
 
  public class ClientActivity extends Activity {
  /** Called when the activity is first created. */
   private EditText serverIp;
 
  private Button connectPhones;
 
  private String serverIpAddress = 192.168.1.27;
 
  private boolean connected = false;
 
  private Handler handler = new Handler();
 
  @Override
  protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.client);
 
 // serverIp = (EditText) findViewById(R.id.server_ip);
  connectPhones = (Button) findViewById(R.id.connect_phones);
 
  connectPhones.setOnClickListener((android.view.View.OnClickListener)
  connectListener);
  }
 
  private OnClickListener connectListener = new
 OnClickListener() {
 
  @Override
  public void onClick(View v) {
  if (!connected) {
//  serverIpAddress = serverIp.getText().toString();
//  if (!serverIpAddress.equals()) {
  Thread cThread = new Thread(new
 ClientThread());
  cThread.start();
 // }
  }
  }
  };
 
  public class ClientThread implements Runnable {
 
  public void run() {
  try {
  InetAddress serverAddr =
  InetAddress.getByName(serverIpAddress);
  Log.d(ClientActivity, C: Connecting...);
  Socket socket = new Socket(serverAddr, );
 
  while (connected) {
 
  try {
  Log.d(ClientActivity, C: Sending
  

[android-developers] Handling process killed by system

2013-06-21 Thread Benoit Vermont
Hi, I've been reading intensively the Android Application Framework FAQ 
(http://developer.android.com/guide/faq/framework.html) and it says that 
the system can kill process if needed to free memory.

Well, fair enough, only it also destroys singletons and static instances. 
So when we launch the application back after that, it tries to restore 
itself, but fails miserably because all static singletons are no more 
available.

What bugs me is that the same documentation (Framework 
FAQ) specifically says : You can take advantage of the fact that your 
application components run in the same process through the use of a 
singleton. This is a class that is designed to have only one instance. It 
has a static method with a name such as getInstance() that returns the 
instance; the first time this method is called, it creates the global 
instance. Because all callers get the same instance, they can use this as a 
point of interaction. For example activity A may retrieve the instance and 
call setValue(3); later activity B may retrieve the instance and call 
getValue() to retrieve the last set value.

But it's not so true, as these singletons are not reliable at all.

I mainly use singleton in my apps to store session variable. But some of 
this variables are quite complex (it can be information about the user, 
trees of object, etc). For exemple, I'm working on an ordering application 
that stores in a singleton a map of stuff the user wan't to buy. This maps 
is complex, it could also store information such as what kind of shipping 
option does the user want, etc...

But let's say I start the app on a cheap device (with low memory), I start 
shopping, but I then receive a call from a friend, I hang up, then I forget 
what I was doing, and launch Angry Birds, and then hey, that's right, I 
was buying stuff, etc... I go back to the application, and the singletons 
don't exist anymore.

Okay, looks like it's a bad idea to use static. But the FAQ is misleading, 
is it not ? The singletons are not really persistant : Once the order is 
finished, they are gonna be destroyed straight away.

I guess that if running the app on api level 14 or more, I could use the 
onTrimMemory method from the Application class 
(http://developer.android.com/reference/android/app/Application.html#onTrimMemory(int))
 
to save/serialize my singleton there, and when the application is 
relaunched, and the singleton is null, restore it.

But what would be the good/best/not so sucky way to handle with 
not-really-persistant-but-it-might-be-nice-to-exist-one-hour kind of object 
?

Thanks.

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: Handling process killed by system

2013-06-21 Thread Streets Of Boston
The singletons stick around as long as your process is alive.

If your process is killed (and therefore your DalvikVM running your app), 
nothing sticks around, including your static variables/fields. This is just 
like any other Java/C/C++ app. The issue is that the OS kills your process, 
not the user and therefore can be highly unpredictable.

That's why your Activities and Fragments have a onSaveInstanceState method.Use 
this to save your session variables into the provided Bundle and pick them 
up again from the 'Bundle savedInstanceState' in your Actiivty's/Fragment's 
onCreate 
method.

If your session variable are complex, let your session objects implement 
Parcelable, which can be saved properly into Bundles. 
You could also have them implement Serializable instead, which can be saved 
to Bundles as well. This'll save you some coding, but is quite bad 
performance-wise. 


On Friday, June 21, 2013 10:25:33 AM UTC-4, Benoit Vermont wrote:

 Hi, I've been reading intensively the Android Application Framework FAQ (
 http://developer.android.com/guide/faq/framework.html) and it says that 
 the system can kill process if needed to free memory.

 Well, fair enough, only it also destroys singletons and static instances. 
 So when we launch the application back after that, it tries to restore 
 itself, but fails miserably because all static singletons are no more 
 available.

 What bugs me is that the same documentation (Framework 
 FAQ) specifically says : You can take advantage of the fact that your 
 application components run in the same process through the use of a 
 singleton. This is a class that is designed to have only one instance. It 
 has a static method with a name such as getInstance() that returns the 
 instance; the first time this method is called, it creates the global 
 instance. Because all callers get the same instance, they can use this as a 
 point of interaction. For example activity A may retrieve the instance and 
 call setValue(3); later activity B may retrieve the instance and call 
 getValue() to retrieve the last set value.

 But it's not so true, as these singletons are not reliable at all.

 I mainly use singleton in my apps to store session variable. But some of 
 this variables are quite complex (it can be information about the user, 
 trees of object, etc). For exemple, I'm working on an ordering application 
 that stores in a singleton a map of stuff the user wan't to buy. This maps 
 is complex, it could also store information such as what kind of shipping 
 option does the user want, etc...

 But let's say I start the app on a cheap device (with low memory), I start 
 shopping, but I then receive a call from a friend, I hang up, then I forget 
 what I was doing, and launch Angry Birds, and then hey, that's right, I 
 was buying stuff, etc... I go back to the application, and the singletons 
 don't exist anymore.

 Okay, looks like it's a bad idea to use static. But the FAQ is misleading, 
 is it not ? The singletons are not really persistant : Once the order is 
 finished, they are gonna be destroyed straight away.

 I guess that if running the app on api level 14 or more, I could use the 
 onTrimMemory method from the Application class (
 http://developer.android.com/reference/android/app/Application.html#onTrimMemory(int))
  
 to save/serialize my singleton there, and when the application is 
 relaunched, and the singleton is null, restore it.

 But what would be the good/best/not so sucky way to handle with 
 not-really-persistant-but-it-might-be-nice-to-exist-one-hour kind of object 
 ?

 Thanks.


-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Socket Programing

2013-06-21 Thread Kristopher Micinski
It's not to make you go away, it's just saying: learn to use the
debugger.  Once you have something that's going wrong with your
program report back and ask for help.

Otherwise nobody knows what to look for, one person could see the
program works completely fine, one person could see it won't compile!
Give a precise description of what the problem is exactly.

Here's an example:
  - I get exception X on line Y which happens when I do Z.

Kris

On Fri, Jun 21, 2013 at 9:49 AM, Ibrahim Sada ibrahim.in...@gmail.com wrote:
 thanks Friend...i will keep ur words...


 On 21 June 2013 18:55, Kristopher Micinski krismicin...@gmail.com wrote:

 Nobody here is going to check your code, why don't you debug it
 yourself and show some effort that you actually tried to diagnose the
 problem: perhaps by debugging and stepping through your code.  Then
 when you find out what might be wrong report back and people can give
 some advice.

 Nodbody is going to reproduce your code because:
   - it takes a long time to do
   - they don't know what you're talking about when you say it doesn't work
   - they find it disrespectful that you're treating them like a
 ragdoll TA who will fix anything
   - they have no idea where to look for problems,

 Kris

 On Fri, Jun 21, 2013 at 8:47 AM, Ibrahim Sada ibrahim.in...@gmail.com
 wrote:
  Please friend check my code..
 
 
  On 21 June 2013 18:16, Ibrahim Sada ibrahim.in...@gmail.com wrote:
 
  package com.in2em.server;
 
  import java.io.BufferedReader;
  import java.io.IOException;
  import java.io.InputStreamReader;
  import java.io.PrintStream;
  import java.net.InetAddress;
  import java.net.ServerSocket;
  import java.net.Socket;
 
  public class Server {
  public static void main(String[] args) {
 
  try {
  // First we create a server socket and bind it to port
  .
  ServerSocket myServerSocket = new ServerSocket();
 
 
  // wait for an incoming connection...
  System.out.println(Server is waiting for an incoming
  connection on host=
  + InetAddress.getLocalHost().getCanonicalHostName()
  +  port= + myServerSocket.getLocalPort());
  Socket skt = myServerSocket.accept();
 
  // ok, got a connection.  Let's use java.io.* niceties to
  read
  and write from the connection.
  BufferedReader myInput = new BufferedReader(new
  InputStreamReader(skt.getInputStream()));
  PrintStream myOutput = new
  PrintStream(skt.getOutputStream());
 
  // attempt to read input from the stream.
  String buf = myInput.readLine();
 
  // if we got input, print it out and write a message back
  to
  the remote client..
  if (buf != null) {
  System.out.println(Server read: [ + buf + ]);
  myOutput.print(got it);
  }
 
  // close the connection.
  skt.close();
  System.out.println(Server is exiting);
 
  } catch (IOException ex) {
  ex.printStackTrace();
  System.out.println(Whoops, something bad happened!  I'm
  outta
  here.);
 
  }
 
 
 
  }
 
  }
 
 
  On 21 June 2013 18:16, Ibrahim Sada ibrahim.in...@gmail.com wrote:
 
  package com.in2em.clientactivity;
 
  import java.io.BufferedWriter;
  import java.io.OutputStreamWriter;
  import java.io.PrintWriter;
  import java.net.InetAddress;
  import java.net.Socket;
 
  import android.app.Activity;
  import android.os.Bundle;
  import android.os.Handler;
  import android.util.Log;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.widget.Button;
  import android.widget.EditText;
 
  public class ClientActivity extends Activity {
  /** Called when the activity is first created. */
   private EditText serverIp;
 
  private Button connectPhones;
 
  private String serverIpAddress = 192.168.1.27;
 
  private boolean connected = false;
 
  private Handler handler = new Handler();
 
  @Override
  protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.client);
 
 // serverIp = (EditText) findViewById(R.id.server_ip);
  connectPhones = (Button)
  findViewById(R.id.connect_phones);
 
  connectPhones.setOnClickListener((android.view.View.OnClickListener)
  connectListener);
  }
 
  private OnClickListener connectListener = new
  OnClickListener() {
 
  @Override
  public void onClick(View v) {
  if (!connected) {
//  serverIpAddress = serverIp.getText().toString();
//  if (!serverIpAddress.equals()) {
  Thread cThread = new Thread(new
  ClientThread());
  cThread.start();
 // }
  

[android-developers] Re: Handling process killed by system

2013-06-21 Thread Benoit Vermont
The problem with parcelable and serializable it that it creates new 
instance of the object for each Activity that is launched. It means that, 
every time you leave an Activity, to go back for instance, you will have to 
write the modified object, and check the onActivityResult each time, to 
update you current version of the session object. It would not really a 
Singleton anymore, and therefor is probably not the solution for an 
instance variable...

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: Handling process killed by system

2013-06-21 Thread Streets Of Boston
Your app is stateful (state is carried over from Activity to Activity) and 
this is indeed an issue you'll run into. If you want to use a static 
variable (object) for your session state, you'll have to code your own 
persistence.

E.g. 
Access your (global/static) state through a static method (Factory 
pattern). If it is not there, read it from a file or database and then 
return it to the caller.
If it is there, just return it to the caller,

On an Activity's/Fragment's onSaveInstanceState, call a (global/static) 
method that will save your current session state to a file or database. 

Note that saving your session state to a file or database should not happen 
on the main UI thread. You should do it in a background thread. 

You could read your most recent session state from a file/database in your 
Application object's 'onCreate' method. It will start a background thread 
reading the session state and keep a tally when the session state has been 
read successfully or not.

Your Activities that need the session state could use that tally to show a 
'waiting/progress' dialog if the session state is still loading or 
something similar. If/when the session state is loaded, continue with your 
Activity's normal functionality.


On Friday, June 21, 2013 10:52:00 AM UTC-4, Benoit Vermont wrote:

 The problem with parcelable and serializable it that it creates new 
 instance of the object for each Activity that is launched. It means that, 
 every time you leave an Activity, to go back for instance, you will have to 
 write the modified object, and check the onActivityResult each time, to 
 update you current version of the session object. It would not really a 
 Singleton anymore, and therefor is probably not the solution for an 
 instance variable...

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] help me to get android Map key

2013-06-21 Thread mansur Android
Hi,

I am trying get android google Map key, where II have followed all the
steps that mentioned
herehttps://developers.google.com/maps/documentation/android/start.
During
the step: Creating an API Project when I tried to ON for *Google Maps
Android API v2,* the service for 'Google Maps Android API Terms of
Servicehttps://developers.google.com/maps/terms.', is
not displaying the* terms and conditions page* for me.

Note: I am trying to generate the debug certificate fingerprint and use it
in my app for testing purpose.
**
*Kindly help me to get google android key for testing purpose*
**
Thanks and Regards,
Mansursab

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Updating APK that supports 3.0+ only

2013-06-21 Thread Darren McEntee
 they will see the last published version that supported their device

So, do i have two published versions of my app, is that allowed?
This new APK update (v1.28 Android 3+) i want to publish soon.
But this is where i get confused, can i have 1.27 (Android 2.1+) app and 
v1.28 (Android 3+) published at the same time so older android users see 
the last published APK version that supported their device?

Thanks,
Darren.

On Friday, 21 June 2013 13:50:46 UTC+1, TreKing wrote:


 On Fri, Jun 21, 2013 at 7:21 AM, Darren McEntee 
 darren@gmail.comjavascript:
  wrote:

 Or how can i get Google to confirm this?


 That's a good one. It's nice to start the day off with a good laugh, 
 thanks. You'll have better luck pulling the back tooth out of a jaguar than 
 getting specific answers about the Play store from Google.

 Look here 
 http://developer.android.com/google/play/dist.html
 http://developer.android.com/distribute/googleplay/publish/index.html
 https://support.google.com/googleplay/android-developer/


 -
 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
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] canvas.drawCircle broken with hardware acceleration on 4.1?

2013-06-21 Thread Leith Bade
I have been banging my head for a while trying to figure out why my custom 
view was not drawing properly until I tried turning off hardware 
acceleration.

It is to do with canvas.drawCircle. It is drawn in solid blue at about 
300px radius.

I also use canvas.drawText and that works fine under hardware acceleration.

The only thing I can think of is that I a using an unsymmetrical 
canvas.scale...

Here is my code:
// Called to redraw the map
@Override
protected void onDraw(Canvas canvas) {
// Check if we are in Eclipse UI editor
if (isInEditMode()) {
return;
}
 // Save the canvas' transforms for unscaled UI elements
canvas.save();
 // Place the map offset in centre of screen
canvas.translate(getWidth() / 2, getHeight() / 2);
 // Zoom the map
canvas.scale((float) (-1.0 / mMapController.getMapMetresPerPixelX()), 
(float) (-1.0 / mMapController.getMapMetresPerPixelY()));
 // Pan the map
canvas.translate((float) mMapController.getMapCentreX(), (float) 
mMapController.getMapCentreY());
 // Draw a circle
canvas.drawCircle(0.0f, 0.0f, 0.01f, mCirclePaint);
 // Restore the canvas' transforms for unscaled UI elements
canvas.restore();
 // Draw the map centre coordinated and scale in top left
canvas.drawText(Centre Coord: ( + String.format(%.4f, 
mMapController.getMapCentreX()) + ,  + String.format(%.4f, 
mMapController.getMapCentreY()) + ), 16.0f * mDisplayMetrics.density, 
36.0f * mDisplayMetrics.scaledDensity, mCoordPaint);
canvas.drawText(Scale: + String.format(%.4f, 
mMapController.getMapScale()), 16.0f * mDisplayMetrics.density, 54.0f * 
mDisplayMetrics.scaledDensity, mCoordPaint);
}

The values of the various variables from the debugger:
isInEditMode() = false
getWidth() = 1080
getHeight() = 1701
getMapMetresPerPixelX() = 5.37037039426811E-5
getMapMetresPerPixelY() = -5.364583215838397E-5
getMapCentreX() = 0.0
getMapCentreY() = 0.0
getMapScale() = 1.0
mCirclePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mCirclePaint.setColor(Color.BLUE); 
mCoordPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mCoordPaint.setColor(Color.BLACK);
mCoordPaint.setTextSize(18.0f * mDisplayMetrics.scaledDensity);
mDisplayMetrics.density = 3.0
mDisplayMettrics.scaledDensity = 3.0

I hope that helps figure it out.

I am going to try on the emulator with 4.2 too see what happens.

Leith

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] canvas.drawCircle broken with hardware acceleration on 4.1?

2013-06-21 Thread Romain Guy
Until 4.2 the hardware accelerated rendering pipeline would render circles
as a texture using the radius you specify in the drawCircle() call. It
would then scale the texture based on the Canvas transform. In this case
you are stretching a picture of a circule that's 1px large, which is why
you are getting a rectangle. Instead of using Canvas.scale(), set the
radius you want directly. Note that we lifted this limitation in 4.2.


On Fri, Jun 21, 2013 at 9:32 AM, Leith Bade le...@leithalweapon.geek.nzwrote:

 I have been banging my head for a while trying to figure out why my custom
 view was not drawing properly until I tried turning off hardware
 acceleration.

 It is to do with canvas.drawCircle. It is drawn in solid blue at about
 300px radius.

 I also use canvas.drawText and that works fine under hardware acceleration.

 The only thing I can think of is that I a using an unsymmetrical
 canvas.scale...

 Here is my code:
 // Called to redraw the map
  @Override
 protected void onDraw(Canvas canvas) {
  // Check if we are in Eclipse UI editor
 if (isInEditMode()) {
  return;
 }
  // Save the canvas' transforms for unscaled UI elements
 canvas.save();
  // Place the map offset in centre of screen
  canvas.translate(getWidth() / 2, getHeight() / 2);
  // Zoom the map
 canvas.scale((float) (-1.0 / mMapController.getMapMetresPerPixelX()),
 (float) (-1.0 / mMapController.getMapMetresPerPixelY()));
  // Pan the map
 canvas.translate((float) mMapController.getMapCentreX(), (float)
 mMapController.getMapCentreY());
  // Draw a circle
 canvas.drawCircle(0.0f, 0.0f, 0.01f, mCirclePaint);
  // Restore the canvas' transforms for unscaled UI elements
  canvas.restore();
  // Draw the map centre coordinated and scale in top left
  canvas.drawText(Centre Coord: ( + String.format(%.4f,
 mMapController.getMapCentreX()) + ,  + String.format(%.4f,
 mMapController.getMapCentreY()) + ), 16.0f * mDisplayMetrics.density,
 36.0f * mDisplayMetrics.scaledDensity, mCoordPaint);
  canvas.drawText(Scale: + String.format(%.4f,
 mMapController.getMapScale()), 16.0f * mDisplayMetrics.density, 54.0f *
 mDisplayMetrics.scaledDensity, mCoordPaint);
  }

 The values of the various variables from the debugger:
 isInEditMode() = false
 getWidth() = 1080
 getHeight() = 1701
 getMapMetresPerPixelX() = 5.37037039426811E-5
 getMapMetresPerPixelY() = -5.364583215838397E-5
 getMapCentreX() = 0.0
 getMapCentreY() = 0.0
 getMapScale() = 1.0
 mCirclePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
 mCirclePaint.setColor(Color.BLUE);
 mCoordPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
 mCoordPaint.setColor(Color.BLACK);
 mCoordPaint.setTextSize(18.0f * mDisplayMetrics.scaledDensity);
 mDisplayMetrics.density = 3.0
 mDisplayMettrics.scaledDensity = 3.0

 I hope that helps figure it out.

 I am going to try on the emulator with 4.2 too see what happens.

 Leith

 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.






-- 
Romain Guy
Android framework engineer
romain...@android.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
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: canvas.drawCircle broken with hardware acceleration on 4.1?

2013-06-21 Thread RichardC
See this thread:
https://groups.google.com/d/msg/android-developers/2DT6JaPszR0/-Q2g6ZLRM5sJ



On Friday, June 21, 2013 5:32:51 PM UTC+1, Leith Bade wrote:

 I have been banging my head for a while trying to figure out why my custom 
 view was not drawing properly until I tried turning off hardware 
 acceleration.

 It is to do with canvas.drawCircle. It is drawn in solid blue at about 
 300px radius.

 I also use canvas.drawText and that works fine under hardware acceleration.

 The only thing I can think of is that I a using an unsymmetrical 
 canvas.scale...

 Here is my code:
 // Called to redraw the map
 @Override
 protected void onDraw(Canvas canvas) {
 // Check if we are in Eclipse UI editor
 if (isInEditMode()) {
 return;
 }
  // Save the canvas' transforms for unscaled UI elements
 canvas.save();
  // Place the map offset in centre of screen
 canvas.translate(getWidth() / 2, getHeight() / 2);
  // Zoom the map
 canvas.scale((float) (-1.0 / mMapController.getMapMetresPerPixelX()), 
 (float) (-1.0 / mMapController.getMapMetresPerPixelY()));
  // Pan the map
 canvas.translate((float) mMapController.getMapCentreX(), (float) 
 mMapController.getMapCentreY());
  // Draw a circle
 canvas.drawCircle(0.0f, 0.0f, 0.01f, mCirclePaint);
  // Restore the canvas' transforms for unscaled UI elements
 canvas.restore();
  // Draw the map centre coordinated and scale in top left
 canvas.drawText(Centre Coord: ( + String.format(%.4f, 
 mMapController.getMapCentreX()) + ,  + String.format(%.4f, 
 mMapController.getMapCentreY()) + ), 16.0f * mDisplayMetrics.density, 
 36.0f * mDisplayMetrics.scaledDensity, mCoordPaint);
 canvas.drawText(Scale: + String.format(%.4f, 
 mMapController.getMapScale()), 16.0f * mDisplayMetrics.density, 54.0f * 
 mDisplayMetrics.scaledDensity, mCoordPaint);
 }

 The values of the various variables from the debugger:
 isInEditMode() = false
 getWidth() = 1080
 getHeight() = 1701
 getMapMetresPerPixelX() = 5.37037039426811E-5
 getMapMetresPerPixelY() = -5.364583215838397E-5
 getMapCentreX() = 0.0
 getMapCentreY() = 0.0
 getMapScale() = 1.0
 mCirclePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
 mCirclePaint.setColor(Color.BLUE); 
 mCoordPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
 mCoordPaint.setColor(Color.BLACK);
 mCoordPaint.setTextSize(18.0f * mDisplayMetrics.scaledDensity);
 mDisplayMetrics.density = 3.0
 mDisplayMettrics.scaledDensity = 3.0

 I hope that helps figure it out.

 I am going to try on the emulator with 4.2 too see what happens.

 Leith


-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] heatmap using TileOverlay on Google Maps v2

2013-06-21 Thread raj
Hi,

I am trying to generate a heatmap, based on a set of LatLng points in 
Android Maps v2.
I am using the algorithm from here: 
http://blog.furiousbob.com/2011/05/12/heating-up-my-new-xoom-tablet/
I have gone through some examples online, but it uses Overlays which is not 
just deprecated, but removed from the v2 of Maps API.

I have been told that I can achieve the same using TileOverlay, which I 
would like to try, but am unable to find even a simple example of it, which 
does not use UrlTileProvider or pre-created set of images.

I can use a View to generate the heatmap as a bitmap(via the view canvas), 
but there dosen't seems to be anyway to map the bitmap to Tiles. 

PS: Currently, I am placing this view over the map, which needs a lot of 
re-computations when the map is panned or zoomed, and would want to avoid 
that.

Please let me know if anyone has any recommendations.

Best,
R

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Updating APK that supports 3.0+ only

2013-06-21 Thread TreKing
On Fri, Jun 21, 2013 at 10:49 AM, Darren McEntee
darren.mcen...@gmail.comwrote:

 So, do i have two published versions of my app, is that allowed?
 This new APK update (v1.28 Android 3+) i want to publish soon.
 But this is where i get confused, can i have 1.27 (Android 2.1+) app and
 v1.28 (Android 3+) published at the same time so older android users see
 the last published APK version that supported their device?


Yes. Again, see Multple APK support. Plenty of info in the links I gave you.

-
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
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] help me to get android Map key

2013-06-21 Thread Elvin
I am doing a app i want to print a text from app to an printer connected
with usb. can any one help me in this please i got the driver for windows 7
but not for the android

how i can do it ?


On Fri, Jun 21, 2013 at 11:45 PM, mansur Android
mansur.andr...@gmail.comwrote:

 Hi,

 I am trying get android google Map key, where II have followed all the
 steps that mentioned 
 herehttps://developers.google.com/maps/documentation/android/start. During
 the step: Creating an API Project when I tried to ON for *Google Maps
 Android API v2,* the service for 'Google Maps Android API Terms of 
 Servicehttps://developers.google.com/maps/terms.', is
 not displaying the* terms and conditions page* for me.

 Note: I am trying to generate the debug certificate fingerprint and use it
 in my app for testing purpose.
 **
 *Kindly help me to get google android key for testing purpose*
 **
 Thanks and Regards,
 Mansursab

 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Cross-platform development question

2013-06-21 Thread Mark Turkel
Hi all,

This is an interesting question, but a bit of background first...my company 
has been developing software for almost 30 years now.  We have always been 
a .net house, but now we're creating Android and iOS apps as well.  I don't 
want to have to write business logic and database access logic for each 
different platform, and since we're doing cloud apps, we should be able to 
call web services to get and put data into the database.

We have been using Entity Framework to communicate with SQL Server for our 
databases, and, as of late, we have been creating Single Page Applications 
using Breeze and Knockout.

We have created RESTful services using the WebAPI, but in working with 
Breeze, we like how it calls an IQueryable object.  My goal is to 
write-once, and be able to re-use for the mobile development.  

LINQ really makes things easier in that we don't have to have a specific 
API call for each entity, but I haven't found the right library, or I'm not 
using the right keywords for Google to search...I dunno, but all I'm 
finding are LINQ libraries that work on data already in memory.  That means 
I will have to bring LOTS of data to the mobile device just to work with 
it, and that's time-consuming and also will quickly eat up storage 
space...and why should I do that, when I have a powerful SQL Server that 
can get me only the data I need.

An example:

Just about every application starts out showing a list of reecords on a 
grid.  (It would require a query that returns an ID, and one or more 
descriptive fields (like first and last name).)  So we know we can create a 
RESTful API called getCustomers() and it would return the list for us to 
populate the grid.  Upon selection of an item, we would then want to make 
another call to the database to populate a detail screen.  We could create 
another RESTful API called getCustomer(id), for example, and it should 
return the fields that we need to populate the screen.

OR we could use the Entity Framework to create a Customers() object, and 
use LINQ to get what we want from it, just by modifying the calling 
URLwhich is easy, fun, and cool in the .net environment, and would 
satisfy my requirements of using the same business code for all platforms.

So here's the question:

How do you make a call to a RESTful service that returns an iQueryable 
object from Android (Java)?  Is there a Breeze-type of library for Android? 
 What is the best way to do this - create specific RESTful APIs, or is 
there a way to use this business layer we have already created that's 
living on 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
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: Cross-platform development question

2013-06-21 Thread Jonathan S
Java is more verbose than C# because it requires a lot of boiler plate to 
get it to work. If you can make a RESTful Service to return data as XML or 
JSON, it would be useful. 

On Friday, June 21, 2013 5:17:31 PM UTC-4, Mark Turkel wrote:

 Hi all,

 This is an interesting question, but a bit of background first...my 
 company has been developing software for almost 30 years now.  We have 
 always been a .net house, but now we're creating Android and iOS apps as 
 well.  I don't want to have to write business logic and database access 
 logic for each different platform, and since we're doing cloud apps, we 
 should be able to call web services to get and put data into the database.

 We have been using Entity Framework to communicate with SQL Server for our 
 databases, and, as of late, we have been creating Single Page Applications 
 using Breeze and Knockout.

 We have created RESTful services using the WebAPI, but in working with 
 Breeze, we like how it calls an IQueryable object.  My goal is to 
 write-once, and be able to re-use for the mobile development.  

 LINQ really makes things easier in that we don't have to have a specific 
 API call for each entity, but I haven't found the right library, or I'm not 
 using the right keywords for Google to search...I dunno, but all I'm 
 finding are LINQ libraries that work on data already in memory.  That means 
 I will have to bring LOTS of data to the mobile device just to work with 
 it, and that's time-consuming and also will quickly eat up storage 
 space...and why should I do that, when I have a powerful SQL Server that 
 can get me only the data I need.

 An example:

 Just about every application starts out showing a list of reecords on a 
 grid.  (It would require a query that returns an ID, and one or more 
 descriptive fields (like first and last name).)  So we know we can create a 
 RESTful API called getCustomers() and it would return the list for us to 
 populate the grid.  Upon selection of an item, we would then want to make 
 another call to the database to populate a detail screen.  We could create 
 another RESTful API called getCustomer(id), for example, and it should 
 return the fields that we need to populate the screen.

 OR we could use the Entity Framework to create a Customers() object, and 
 use LINQ to get what we want from it, just by modifying the calling 
 URLwhich is easy, fun, and cool in the .net environment, and would 
 satisfy my requirements of using the same business code for all platforms.

 So here's the question:

 How do you make a call to a RESTful service that returns an iQueryable 
 object from Android (Java)?  Is there a Breeze-type of library for Android? 
  What is the best way to do this - create specific RESTful APIs, or is 
 there a way to use this business layer we have already created that's 
 living on 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
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] How to support Redeem Code in Android App?

2013-06-21 Thread ASB
Hi Android Developers,

I have recently created a Physics based app called *High School Physics*. 
This app helps the high school  university students who are interested in 
physics to learn the concepts clearly without getting intimidated by the 
sheer amount of Mathematics involved in it. 

The app is published at 
https://play.google.com/store/apps/details?id=com.asb.full.highschoolphysics

Now coming to the problem,
Currently this app follows a freemium model with IAP APIs, but I wanted 
something that Apple Store supports: *Redeem Coupons*. I want some 
reviewers to try the app and want to share the redeem coupon so that they 
can unlock it completely. Is it possible to have such feature in Android 
App? Are there any frameworks to support this?

Regards,
Arjun S Bharadwaj

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: canvas.drawCircle broken with hardware acceleration on 4.1?

2013-06-21 Thread Leith Bade
Thanks for the fast reply guys!

Is there a page that lists all the limitations of the hardware accelerated 
rendering engine and the Android versions applicable? That would be very 
useful.

It's cool to see the Android developers actually read these emails.

On Saturday, 22 June 2013 03:29:09 UTC+10, RichardC wrote:

 See this thread:
 https://groups.google.com/d/msg/android-developers/2DT6JaPszR0/-Q2g6ZLRM5sJ



 On Friday, June 21, 2013 5:32:51 PM UTC+1, Leith Bade wrote:

 I have been banging my head for a while trying to figure out why my 
 custom view was not drawing properly until I tried turning off hardware 
 acceleration.

 It is to do with canvas.drawCircle. It is drawn in solid blue at about 
 300px radius.

 I also use canvas.drawText and that works fine under hardware 
 acceleration.

 The only thing I can think of is that I a using an unsymmetrical 
 canvas.scale...

 Here is my code:
 // Called to redraw the map
 @Override
 protected void onDraw(Canvas canvas) {
 // Check if we are in Eclipse UI editor
 if (isInEditMode()) {
 return;
 }
  // Save the canvas' transforms for unscaled UI elements
 canvas.save();
  // Place the map offset in centre of screen
 canvas.translate(getWidth() / 2, getHeight() / 2);
  // Zoom the map
 canvas.scale((float) (-1.0 / mMapController.getMapMetresPerPixelX()), 
 (float) (-1.0 / mMapController.getMapMetresPerPixelY()));
  // Pan the map
 canvas.translate((float) mMapController.getMapCentreX(), (float) 
 mMapController.getMapCentreY());
  // Draw a circle
 canvas.drawCircle(0.0f, 0.0f, 0.01f, mCirclePaint);
  // Restore the canvas' transforms for unscaled UI elements
 canvas.restore();
  // Draw the map centre coordinated and scale in top left
 canvas.drawText(Centre Coord: ( + String.format(%.4f, 
 mMapController.getMapCentreX()) + ,  + String.format(%.4f, 
 mMapController.getMapCentreY()) + ), 16.0f * mDisplayMetrics.density, 
 36.0f * mDisplayMetrics.scaledDensity, mCoordPaint);
 canvas.drawText(Scale: + String.format(%.4f, 
 mMapController.getMapScale()), 16.0f * mDisplayMetrics.density, 54.0f * 
 mDisplayMetrics.scaledDensity, mCoordPaint);
 }

 The values of the various variables from the debugger:
 isInEditMode() = false
 getWidth() = 1080
 getHeight() = 1701
 getMapMetresPerPixelX() = 5.37037039426811E-5
 getMapMetresPerPixelY() = -5.364583215838397E-5
 getMapCentreX() = 0.0
 getMapCentreY() = 0.0
 getMapScale() = 1.0
 mCirclePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
 mCirclePaint.setColor(Color.BLUE); 
 mCoordPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
 mCoordPaint.setColor(Color.BLACK);
 mCoordPaint.setTextSize(18.0f * mDisplayMetrics.scaledDensity);
 mDisplayMetrics.density = 3.0
 mDisplayMettrics.scaledDensity = 3.0

 I hope that helps figure it out.

 I am going to try on the emulator with 4.2 too see what happens.

 Leith



-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] How to support Redeem Code in Android App?

2013-06-21 Thread Michael Leung
Do you mean you send the code to the users then they can download your app
free. I don't think Google play has this function.


On Sat, Jun 22, 2013 at 1:54 PM, ASB arjun.s@gmail.com wrote:

 Hi Android Developers,

 I have recently created a Physics based app called *High School Physics*.
 This app helps the high school  university students who are interested in
 physics to learn the concepts clearly without getting intimidated by the
 sheer amount of Mathematics involved in it.

 The app is published at https://play.google.com/**
 store/apps/details?id=com.asb.**full.highschoolphysicshttps://play.google.com/store/apps/details?id=com.asb.full.highschoolphysics

 Now coming to the problem,
 Currently this app follows a freemium model with IAP APIs, but I wanted
 something that Apple Store supports: *Redeem Coupons*. I want some
 reviewers to try the app and want to share the redeem coupon so that they
 can unlock it completely. Is it possible to have such feature in Android
 App? Are there any frameworks to support this?

 Regards,
 Arjun S Bharadwaj

 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.






-- 
Regards,
Michael Leung
http://www.itblogs.info - My IT Blog
http://diary.skynovel.info - My Blog
http://www.michaelleung.info - My Homepage

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.