[android-developers] connect android app to remote web services

2014-12-08 Thread asma rezgui
Hello evrybody,
i would like to ask  you what can i do to let my android application
connect to remote web services . When i tried with local configuration on
the emulator it works fine but when i m changing the url to connect to the
 remote server ( by DNS) the web services are not reached from the android
client.

Can someone help me please ?

Thanks.

-- 
*REZGUI Asma *
*Consultant J2EE*

-- 
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/d/optout.


Re: [android-developers] connect android app to remote web services

2014-12-08 Thread TreKing
On Mon, Dec 8, 2014 at 4:05 AM, asma rezgui asmarezgu...@gmail.com wrote:

 Can someone help me please ?


You'll have to provide a little more information, like how you're trying to
connect, what URL you're trying to connect to, and what errors you're
seeing.

-
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/d/optout.


Re: [android-developers] connect android app to remote web services

2014-12-08 Thread Mukesh Srivastav
I have helped here already... she was not having the internet connection on
her device and therefor thei application was throwing the exception
hostnotfound and also she did not returned the statment on exception but
instead trying to do the json parsing.

On Mon, Dec 8, 2014 at 7:36 PM, TreKing treking...@gmail.com wrote:


 On Mon, Dec 8, 2014 at 4:05 AM, asma rezgui asmarezgu...@gmail.com
 wrote:

 Can someone help me please ?


 You'll have to provide a little more information, like how you're trying
 to connect, what URL you're trying to connect to, and what errors you're
 seeing.


 -
 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/d/optout.




-- 
Warm Regards,
*Mukesh Kumar*,
Android Consultant/Freelancer,
India,Hyderabad.

-- 
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/d/optout.


Re: [android-developers] connect android app to remote web services

2014-12-08 Thread asma rezgui
Thank you a lot for your help

2014-12-08 18:50 GMT+01:00 Mukesh Srivastav mukicha...@gmail.com:

 I have helped here already... she was not having the internet connection
 on her device and therefor thei application was throwing the exception
 hostnotfound and also she did not returned the statment on exception but
 instead trying to do the json parsing.

 On Mon, Dec 8, 2014 at 7:36 PM, TreKing treking...@gmail.com wrote:


 On Mon, Dec 8, 2014 at 4:05 AM, asma rezgui asmarezgu...@gmail.com
 wrote:

 Can someone help me please ?


 You'll have to provide a little more information, like how you're trying
 to connect, what URL you're trying to connect to, and what errors you're
 seeing.


 -
 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/d/optout.




 --
 Warm Regards,
 *Mukesh Kumar*,
 Android Consultant/Freelancer,
 India,Hyderabad.

 --
 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/d/optout.




-- 
*REZGUI Asma *
*Consultant J2EE*

-- 
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/d/optout.


Re: [android-developers] Re: Is it possible, that Android kills a service inside an app?

2014-12-08 Thread Peter Teoh

 *The Service can still be killed by Android.*


Any proofs?

not any proofs, but just some discussion is possible:

Read this:

http://developer.android.com/reference/android/content/Context.html#startService%28android.content.Intent%29

From above, there is a line:

The only time they should be stopped is if the current foreground
application is using so many resources that the service needs to be killed.

This is talking about the OOM killer.

In traditional Linux OOM is initiated from the kernel.   But here in
Android there is a special lowmemorykiller daemon:

https://source.android.com/devices/tech/low-ram.html   (looked out for
lowmemorykiller, the name as it is)

Under Android source code:

frameworks/base/services/core/java/com/android/server/am/ActiveServices.java:
final void killServicesLocked(ProcessRecord app, boolean allowRestart) {

frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java:
mServices.killServicesLocked(app, allowRestart);

You can see the caller and the implementer of the function above.   It is
where BIND_ALLOW_OOM_MANAGEMENT parameter are checked, and thus killing the
services is done if necessary.

More info:

http://stackoverflow.com/questions/18972590/the-timing-to-start-android-low-memory-killer

http://forum.xda-developers.com/showthread.php?t=904023

And this is from Linux kernel source code (under drivers/staging/android
means it is still yet to be approved by linux kernel - at that time):

http://www.cs.fsu.edu/~baker/devices/lxr/http/source/linux/drivers/staging/android/lowmemorykiller.txt

http://www.programering.com/a/MjNzADMwATE.html

http://lwn.net/Articles/511731/

http://varun-anand.com/mem_mgmt.html

Regards,
Peter Teoh

-- 
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/d/optout.


[android-developers] onCharacteristicWrite Error Status 14

2014-12-08 Thread Tony Pitman
I am writing an Android app and using api 18 to do BTLE.

I am able to connect, discover services and characteristics and read the 
characteristic from the peripheral.

When I try to write using WriteCharacterstic I get the onCharacteristicWrite, 
but the status is 14. I can't find this status anywhere in the 
documentation or anywhere else.

The value does not make it to the peripheral. Can someone tell me what this 
code means and why the value might not be writing?

-- 
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/d/optout.


[android-developers] Yet another case of not getting BTLE notifications

2014-12-08 Thread Tony Pitman
I have read several posting on this same thing and tried all of the 
suggestions.

I am able to discover and connect to my BTLE device (it is actually an iOS 
device).

My Android device is 4.4 and has BTLE.

After I connect and get all the services and characteristics I try to read 
the one I am using and it works fine. If I update the value on the iOS 
device and do another read I get the new value as I would expect.

I use this code:

protected static final UUID 
CHARACTERISTIC_UPDATE_NOTIFICATION_DESCRIPTOR_UUID = UUID.fromString(
2902--1000-8000-00805f9b34fb);
if (gatt.setCharacteristicNotification(characteristic, true)) {

BluetoothGattDescriptor descriptor = 
characteristic.getDescriptor(CHARACTERISTIC_UPDATE_NOTIFICATION_DESCRIPTOR_UUID);
if (descriptor != null) {

descriptor.setValue(enabled ? 
BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE : 
BluetoothGattDescriptor.DISABLE_NOTIFICATION_VALUE);
if (gatt.writeDescriptor(descriptor)) {
// success
}
else {
// failed
}
}
}

It reaches the // success line so it seems to be doing what I want I just 
never get the notifications. I know that this characteristic I am trying to 
subscribe to has the notification flag set on it. I do that in the iOS 
application. Unless something is going wrong there I guess.

How can I debug this to figure out what is going on? Should I get something 
in the onDescriptor callback maybe? Where do I look and how do I diagnose?

-- 
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/d/optout.


Re: [android-developers] Re: Is it possible, that Android kills a service inside an app?

2014-12-08 Thread gjs
Hi,

You can prove this yourself by creating a test app with a service  running 
a few tests.

Run the test app  start the service on a recent device with Android V4+ 
then leave the service running  go  do other stuff for a while.

Sometime during the next few hours you probably find that your service has 
been killed by the OS regardless of whether the service was busy or not ( 
regardless of OOM pressure).

If you want the service to remain running longer than a few hours you will 
need to use 
'startForeground' 
http://developer.android.com/reference/android/app/Service.html#startForeground(int,
 
android.app.Notification) but even that will not prevent the OS from 
killing your service when it thinks it really needs to due to memory 
pressure.

Once upon a time before approximately Android V2.2 services were left 
running indefinitely  weren't eagerly killed by the OS ( even without 
having to specify 'startForeground' or 'setForeground' ) provided there was 
no memory pressure, but that's no longer the case.

What's officially documented  what actually happens on real devices will 
vary, so prove to your own satisfaction by testing...

Regards

On Tuesday, December 9, 2014 12:01:12 PM UTC+11, Peter Teoh wrote:

 *The Service can still be killed by Android.*


 Any proofs?

 not any proofs, but just some discussion is possible:

 Read this:


 http://developer.android.com/reference/android/content/Context.html#startService%28android.content.Intent%29

 From above, there is a line:   

 The only time they should be stopped is if the current foreground 
 application is using so many resources that the service needs to be killed.

 This is talking about the OOM killer.

 In traditional Linux OOM is initiated from the kernel.   But here in 
 Android there is a special lowmemorykiller daemon:

 https://source.android.com/devices/tech/low-ram.html   (looked out for 
 lowmemorykiller, the name as it is)

 Under Android source code:


 frameworks/base/services/core/java/com/android/server/am/ActiveServices.java:
 final void killServicesLocked(ProcessRecord app, boolean allowRestart) 
 {


 frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java:
 mServices.killServicesLocked(app, allowRestart);

 You can see the caller and the implementer of the function above.   It is 
 where BIND_ALLOW_OOM_MANAGEMENT parameter are checked, and thus killing the 
 services is done if necessary.

 More info:


 http://stackoverflow.com/questions/18972590/the-timing-to-start-android-low-memory-killer

 http://forum.xda-developers.com/showthread.php?t=904023

 And this is from Linux kernel source code (under drivers/staging/android 
 means it is still yet to be approved by linux kernel - at that time):


 http://www.cs.fsu.edu/~baker/devices/lxr/http/source/linux/drivers/staging/android/lowmemorykiller.txt

 http://www.programering.com/a/MjNzADMwATE.html

 http://lwn.net/Articles/511731/

 http://varun-anand.com/mem_mgmt.html

 Regards, 
 Peter Teoh


-- 
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/d/optout.