[android-developers] Re: Anyone know how to calculate speed WITHOUT GPS?

2011-01-12 Thread gjs
Hi,

I think you could still extrapolate (average) speed for some trip with
intermittent GPS signals.

If you get a GPS fix at the start of the journey and then at the end
you can calculate an average speed based on the time duration and
straight line distance between these points, any additional points
(GPS or course grained towers/wifi/skyhook) during the journey would
be a bonus to increase the accuracy of the speed and distance calcs.

This depends on whether you actually require real time speed ?

Regards


On Jan 13, 5:37 pm, Bob Kerns  wrote:
> I've never gotten around to experimenting to see just how good you CAN
> get -- but there are some reference points that should help
> considerably.
>
> * Gravity
> * The magnetic field
> * Any period of low acceleration noise in the vicinity of about 1 g
> total acceleration probably indicates it has been set down on a
> surface (or in the original scenario -- the car has come to a stop).
>
> There other possibilities in other situations:
> * Camera data can indicate relative motion
> * Acoustical echoic signature and ambient sounds
> * Wifi transmitter signal strengths
> * 3G signal strengths. (Hey, I'm outdoors, maybe try GPS again!)
> * Sonar!
>
> A typical android device has more senses than humans. We synthesize an
> understanding of our location and environment via a process of sensor
> fusion. There's more opportunity for this sort of thing on Android
> than Nintendo, as there's more processing power available and more
> sensors to gather information -- especially when connected to a power
> source or otherwise on a larger power budget than a cell phone. Look
> at Dempster-Shafer Theory and Kahlman filters for techniques to handle
> this sort of process.
>
> On Jan 12, 5:10 pm, keyboardr  wrote:
>
>
>
>
>
>
>
> > I know Nintendo originally tried to use accelerometers to figure out
> > where it was pointing, and while that's theoretically possible, in
> > practice the accuracy just isn't good enough.  The acceleration most
> > of the time is small enough that even the slightest error will throw
> > the whole calculation way off, and since you're relying on all of your
> > previous results, errors get compounded over time.  That's why
> > Nintendo switched to an IR camera setup.
>
> > On Jan 12, 7:22 am, cellurl  wrote:
>
> > > couldn't you use the accelerometer?
> > > Integrate that? Use time. s=Integral(a  dt)
> > > If that doesn't work, look to skyhook wireless!
> > > -cellurl
>
> > > On Jan 12, 8:20 am, Brill Pappin  wrote:
>
> > > > Well you pretty much need distance traveled over time to find speed,
> > > > so anything you can do to determine distance travelled should allow
> > > > you to calculate the speed.
>
> > > > For instance you could use cell tower location, but I wouldn't class
> > > > it as even remotely accurate.
> > > > If you want to give an actual real value, your going to need the
> > > > accuracy of the GPS unit.
>
> > > > - Brill Pappin
>
> > > > On Jan 11, 11:13 pm, darrinps  wrote:
>
> > > > > All the examples I see use GPS, and I have that working just fine but
> > > > > I've noticed that every time I'm in a car, that unless the phone is
> > > > > close to a window or the windshield the GPS does not work so...
>
> > > > > I thought that there should be a way using course grained location
> > > > > between cell towers. Does anyone know if this is possible and if so
> > > > > might know where I could find some sample code please?
>
> > > > > Thanks!
>
> > > > > Darrin

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: I ask for power off but get reboot instead sometimes

2011-01-12 Thread Zsolt Vasvari
Yes, I have the exact same problem.  Once in a while it will reboot if
I select the Power Off option.  But the touch screen is very flaky.  A
lot of times when I have it connected in debug mode, it loses
calibration and I have to put it to sleep and back on to get it
fixed.  So it could be just the screen calibration is getting out of
whack and it thinks it's hitting a different button.

As far as the HW problem, I also had to have my N1 replaced once due
to a faulty power switch.

On Jan 13, 6:01 am, higonnet  wrote:
> Subject line basically says it all.
>
> As a completely wild guess, I'd say this happens 10% to 15% of the
> time, on my unrooted, normal Nexus One.
>
> I find this disconcerting at best, since the reason I'm powering the
> thing off is that it isn't behaving the way it usually
> does...
>
> Not at all sure of following, but seems to happen more with 2.2 than
> before?
>
> Bernard Higonnet

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] there is any view like of html in android SDK?

2011-01-12 Thread goodwin
tag  in html , it can contain  and , i want to use a view like this in android.I want an optgroup and a 
value. Is there any ready-made?

any help will be appreciated.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: What is the name of this widget?

2011-01-12 Thread mort
On 12 Jan., 09:12, Dianne Hackborn  wrote:
> Many classes that are public make use of private classes for implementation.
>  That isn't a reason to make those other classes public.

Of course. I just meant in this case the public and private classes do
share the problems.
If one day you'll replace NumberPicker, wouldn't that also cause
troubles to keep Date- and TimePicker compatible?

> Sure and then we end up with crud in the API we can't get rid of.  This is a
> pretty trivial widget, and everyone has the source code to it; we aren't
> going to junk up the API for this thing.

Sure. If the "old crap" is only in apps which cloned it, you can
savely remove it from the system core. I wouldn't like to drag along
two similar, incompatible variants of widgets for the same purpose as
well.
Maybe I just underestimated the possible compatibility issues. My
thoughts were along the lines "Range in, number out - there's no
complicated interface. And a wheel like the one posted above could
easily fit the current widget size." But I don't know what you've got
in mind for future implementations...
Anyway. You've done so many good extensions in the past, I'm positive
you'll find a good solution with an upcoming update.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Listening to HFP events

2011-01-12 Thread qwesthead
We've a bluetooth application which uses SPP protocol. For better
connection manageability, in our app we would like to listen to HFP
related events like Bluetooth connected/disconnected. Is that
possible? Is there a list of Bluetooth events that we can listen to?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] what is HIPRI connection

2011-01-12 Thread Zhihong GUO
Hi all,

There is a kind of connection called HIPRI, which is categoried by Android
as a connection like MMS, or SUPL, DUN or Mobile. It is said by the SDK web
page that it is :

A High Priority Mobile data connection. This connection is typically the
same as 
TYPE_MOBILE
but
the routing setup is different. Only requesting processes will have access
to the Mobile DNS servers and only IP's explicitly requested via
requestRouteToHost(int,
int) will route over this interface if a default route exists.

I am not very clear about the description. If we start connection on HIPRI,
will the connection be teared down when Wi-Fi connection established?

If we use the connection after there is Wi-Fi connection, that means, we
want to make dual connection on Wi-Fi and HIPRI, do we have to use the IP
explicitly request instead of the string like http://www.google.com?

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

[android-developers] Performance issue with mapview when using large number of items

2011-01-12 Thread Stephan Wiesner
Hi,
my app is supposed to display about 7000 items on a mapview (distributed
over a whole country), but I have serious performance issues with this.
Currently I only display the items that are in an 15km radius of the center
of the map (user has to press a button for this) and everything works fine.
I would prefer to show all items at start, though. That is possible, but
moving the map around becomes very slow (guess I need that new LG phone
after all :-).

I extend ItemizedOverlay and the problem seems to be in


public void draw(Canvas canvas, MapView mapView, boolean shadow) {
if (canvas != null && mapView != null) {
super.draw(canvas, mapView, false);
}
}

if I comment out the call to super, the moving of the map is smooth (but of
course nothing is displayed).


Any hints?
Thanks,
Stephan

-- 
Interessiert an Android?
http://android-schweiz.blogspot.com/
Whant to learn German?
http://german-podcast.blogspot.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

Re: [android-developers] Is it possible to upload?

2011-01-12 Thread Kumar Bibek
You can use Java if you want, else, use the normal HTTP Get Post requests
mentioned there.


Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.com



On Thu, Jan 13, 2011 at 12:29 PM, Abhilash baddam <
abhilash.androiddevelo...@gmail.com> wrote:

> Hi kumar,
>
>In Youtube official website i was found  apis for
> java,.net,php etc but i didn't find any api's for android there. can you
> send me the links where i can get those apis for android.
>
>
> On Wed, Jan 12, 2011 at 9:22 PM, Kumar Bibek  wrote:
>
>> Have you looed into the APIs? If yes, what are the problems that you are
>> facing. If no, please go through it first.
>>
>>
>> Kumar Bibek
>> http://techdroid.kbeanie.com
>> http://www.kbeanie.com
>>
>>
>>
>> On Wed, Jan 12, 2011 at 8:59 PM, Abhilash baddam <
>> abhilash.androiddevelo...@gmail.com> wrote:
>>
>>> Hi Kumar Bibek,
>>>
>>>if you don't mind Can you help me out more to
>>> solve this problem.
>>>
>>>
>>> On Wed, Jan 12, 2011 at 7:17 PM, Kumar Bibek wrote:
>>>
 Sure. Look at the youtube official APIs. You will find a few code
 snippets as well

 Kumar Bibek
 http://techdroid.kbeanie.com
 http://www.kbeanie.com



 On Wed, Jan 12, 2011 at 6:50 PM, Abhilash baddam <
 abhilash.androiddevelo...@gmail.com> wrote:

> Hi friends,
>
>I want to upload a file like mp3 or 3gp to *youtube*from 
> my application. Is it possible if yes can anyone
>   send me code snippet or links which is useful regarding this
> issue.
>
>
>
>
>
>
> Regards,
> Abhilash.B
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to
> android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en


  --
 You received this message because you are subscribed to the Google
 Groups "Android Developers" group.
 To post to this group, send email to
 android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en
>>>
>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Android Developers" group.
>>> To post to this group, send email to android-developers@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> android-developers+unsubscr...@googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/group/android-developers?hl=en
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to android-developers@googlegroups.com
>> To unsubscribe from this group, send email to
>> android-developers+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>>
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: HttpURLConnection gives UnknownHostException

2011-01-12 Thread Bob Kerns
UnknownHostException means your device was unable to get a positive
response to the DNS query trying to look up the hostname.

It doesn't distinguish between "We couldn't talk to the DNS server",
"we have no network connection right now", "we have never even HEARD
of net work, what's that?", or "we carefully and thoroughly discussed
it with the DNS server, which in turn discussed it with the relevant
authoritative DNS servers, and can conclusively state, that the host
named does not exist at this time".

What you CAN say, is it never got to the point of actually trying to
talk to that host, because it didn't get enough information to do so.
That is, it is not saying "we've heard of that host, but it doesn't
seem to be there".

The most likely cause is a temporary failure in your wifi connection,
just as it was trying the DNS lookup. But the DNS server itself could
be to blame, or if it's a DNS server on your site, the connection
upstream, or an upstream DNS server could be to blame.

I use my local wifi server as a DNS server. It's been giving me
problems like this lately, even on wired connections. Plus, it is not
compatible with IPv6, so I'm going to need to upgrade it soon. I could
configure it to advertise OpenDNS servers instead (which is what it
itself is using), but have slightly longer lookups and no cached data
if the cable connection hiccups. If it's the cable connection that's
at fault, then I'll have these problems anyway. It won't be easy to
track down.

On Jan 12, 8:44 pm, Ankur Avlani  wrote:
> Unfortunately, the server is not local.
>
>
>
>
>
>
>
> On Wed, Jan 12, 2011 at 4:15 PM, Dan  wrote:
> > Hello All,
>
> > I have had this error both on emulator and a Motorola Droid while
> > using a WIFI connection.  I have surrounded the http request with WIFI
> > state checks and before and after WIFI is reported state 3
> > (WIFI_STATE_ENABLED) and a connection speed of 54 . I have also
> > confirmed, using an adb shell with the emulator, that the emulator
> > cannot ping the website in question giving a domain resolution error.
> > To compare notes with Ankur, is the server on your LAN and the IP used
> > internal? mine is.
>
> > I have also tried AndroidHttpClient which does work on the same url.
>
> > -Dan
>
> > On Jan 12, 12:23 pm, Ankur Avlani  wrote:
> > > True, I agree with what you say.  Its just that I feel, other apps should
> > > also break or give error.
>
> > > Anywayz, Thanks a lot for your inputs.
>
> > > regards,
> > > Ankur.
>
> > > On Wed, Jan 12, 2011 at 12:17 PM, Brill Pappin  wrote:
> > > > Well i suppose thats possible if your messing with the network stack,
> > > > but it's pretty low level for Java/Android.
> > > > I guess its also possible that the Android version you have has a
> > > > crappy stack or driver... or you have rooted it and have been messing
> > > > around under the covers so to speak.
>
> > > > There is nothing in Android really that would allow you to mess it up
> > > > that badly AFAIK, so I doubt it's your application causing the problem
> > > > if your not specifically getting under the covers.
>
> > > > However, the meaning of the exception is clear:
>
> > > >http://download.oracle.com/javase/1.4.2/docs/api/java/net/UnknownHost.
> > ..
> > > > and your app doesn't really control the process of translating a
> > > > domain to an ip.
>
> > > > - Brill Pappin
>
> > > > On Jan 12, 2:54 pm, Ankur Avlani  wrote:
> > > > > Somehow I have this feeling it is related to my app only.  Other apps
> > on
> > > > the
> > > > > phone, I don't see any such issue.  Even when browsing on my phone, I
> > > > don't
> > > > > see any error.
>
> > > > > On Wed, Jan 12, 2011 at 11:41 AM, Kumar Bibek 
> > > > wrote:
> > > > > > By Wi-Fi, I meant, you phone's Wi-Fi could be turning on and off.
> > There
> > > > is
> > > > > > no other reason I can think of. It happens for me as well,
> > sometimes.
>
> > > > > > Kumar Bibek
> > > > > >http://techdroid.kbeanie.com
> > > > > >http://www.kbeanie.com
>
> > > > > > On Thu, Jan 13, 2011 at 1:10 AM, Ankur Avlani <
> > ankuravl...@gmail.com
> > > > >wrote:
>
> > > > > >> I am sorry, that somehow doesn't convince me.  I am connected to
> > the
> > > > same
> > > > > >> wifi on my laptop and i never see any web page load error on my
> > > > laptop.
>
> > > > > >> On Wed, Jan 12, 2011 at 11:38 AM, Kumar Bibek <
> > coomar@gmail.com
> > > > >wrote:
>
> > > > > >>> Yup, then it's a problem with your Wi-Fi.
>
> > > > > >>> Kumar Bibek
> > > > > >>>http://techdroid.kbeanie.com
> > > > > >>>http://www.kbeanie.com
>
> > > > > >>> On Thu, Jan 13, 2011 at 1:07 AM, Ankur Avlani <
> > ankuravl...@gmail.com
> > > > >wrote:
>
> > > > >  I am connected to network, I am on Wifi.  If i try again it
> > works.
> > > >  Its
> > > > >  just random.
>
> > > > >  On Wed, Jan 12, 2011 at 11:34 AM, Kumar Bibek <
> > coomar@gmail.com
> > > > >wrote:
>
> > > > > > This error/exception comes because of no network connectivity.
>
> > > > > 

Re: [android-developers] Is it possible to upload?

2011-01-12 Thread Abhilash baddam
Hi kumar,

   In Youtube official website i was found  apis for
java,.net,php etc but i didn't find any api's for android there. can you
send me the links where i can get those apis for android.

On Wed, Jan 12, 2011 at 9:22 PM, Kumar Bibek  wrote:

> Have you looed into the APIs? If yes, what are the problems that you are
> facing. If no, please go through it first.
>
>
> Kumar Bibek
> http://techdroid.kbeanie.com
> http://www.kbeanie.com
>
>
>
> On Wed, Jan 12, 2011 at 8:59 PM, Abhilash baddam <
> abhilash.androiddevelo...@gmail.com> wrote:
>
>> Hi Kumar Bibek,
>>
>>if you don't mind Can you help me out more to solve
>> this problem.
>>
>>
>> On Wed, Jan 12, 2011 at 7:17 PM, Kumar Bibek wrote:
>>
>>> Sure. Look at the youtube official APIs. You will find a few code
>>> snippets as well
>>>
>>> Kumar Bibek
>>> http://techdroid.kbeanie.com
>>> http://www.kbeanie.com
>>>
>>>
>>>
>>> On Wed, Jan 12, 2011 at 6:50 PM, Abhilash baddam <
>>> abhilash.androiddevelo...@gmail.com> wrote:
>>>
 Hi friends,

I want to upload a file like mp3 or 3gp to *youtube*from my 
 application. Is it possible if yes can anyone
   send me code snippet or links which is useful regarding this
 issue.






 Regards,
 Abhilash.B

 --
 You received this message because you are subscribed to the Google
 Groups "Android Developers" group.
 To post to this group, send email to
 android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en
>>>
>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Android Developers" group.
>>> To post to this group, send email to android-developers@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> android-developers+unsubscr...@googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/group/android-developers?hl=en
>>
>>
>>  --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to android-developers@googlegroups.com
>> To unsubscribe from this group, send email to
>> android-developers+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>>
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Gingerbread BroadcastReceiver Issue

2011-01-12 Thread Dianne Hackborn
Services will be occasionally killed in the background if they aren't set to
be foreground.  This is all normal behavior.  You control what happens when
they restart (if they restart at all) through what you return from
onStartCommand().  It looks like you are not explicitly returning anything,
and haven't set your target SDK version to be >= the 2.0 level, so you are
getting the old behavior.

More discussion is here:
http://android-developers.blogspot.com/2010/02/service-api-changes-starting-with.html

On Wed, Jan 12, 2011 at 8:31 PM, Jake Basile  wrote:

> I did some log searching, and found that this happens before the service
> stops working:
> 01-12 23:26:14.268: INFO/ActivityManager(109): No longer want
> com.jakebasile.android.hearingsaver (pid 31188): hidden #16
> 01-12 23:26:14.287: WARN/ActivityManager(109): Scheduling restart of
> crashed service com.jakebasile.android.hearingsaver/.RegistrationService in
> 5000ms
> 01-12 23:26:18.068: DEBUG/dalvikvm(496): GC_EXPLICIT freed 23K, 55% free
> 3445K/7559K, external 1625K/2137K, paused 69ms
> 01-12 23:26:19.322: INFO/ActivityManager(109): Start proc
> com.jakebasile.android.hearingsaver for service
> com.jakebasile.android.hearingsaver/.RegistrationService: pid=31563
> uid=10064 gids={}
>
> But afterwards, the service no longer works correctly. My onStartCommand
> isn't called, so the receiver doesn't get re-registered.
>
> I don't understand why it would be a "crashed service". There is no error
> info being printed, and my code doesn't really *do* anything to cause a
> crash. Any ideas?
>
> --
> 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
>



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Sharing data between apps

2011-01-12 Thread Bob Kerns
Oh, easy question!

10 bytes of data when it's describing your current brake pedal
pressure is very different than 10 bytes describing the high score to
ultimately post on a web site somewhere when it gets around to
updating. It makes a real difference how quickly and reliably the data
is delivered.

10 bytes of data when it is describing a selected record in a large
database is very different from 10 bytes of data which describe
geographic coordinates on the earth's surface. In the latter case,
there's a frame of reference that even a space alien can understand
without a device. In the former, you need not only the database, but
the particular process of selection, which may in turn involve
information known only within the same process.  Those 10 bytes may be
meaningless by themselves, taken out of the context in which they have
meaning.

10 bytes is 10 bytes -- so long as you don't care about what those
bytes mean or why they exist. That is, if they're worthless. If
they're valuable, on the other hand, it's a whole other story.

On Jan 12, 6:29 pm, John Lussmyer  wrote:
> On Wed, Jan 12, 2011 at 6:18 PM, Mark Murphy wrote:
>
> > On Wed, Jan 12, 2011 at 8:35 PM, John Lussmyer 
> > wrote:>
> > > 10 bytes of data is 10 bytes of data.
>
> > Not really, but you are certainly welcome to your opinion.
>
> Now this has me curious.  What definitions of data would make a difference?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] How to get raw data from audio decoded buffer

2011-01-12 Thread npak243
Hi everyone,

Does anyone know how to decode an audio file (i.e *.mp3) to raw data
by using a certain class on Android? Because I want to use the decoded
data rather than using MediaPlayer to play audio file directly.

Thanks,
NPAK

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Anyone know how to calculate speed WITHOUT GPS?

2011-01-12 Thread Bob Kerns
I've never gotten around to experimenting to see just how good you CAN
get -- but there are some reference points that should help
considerably.

* Gravity
* The magnetic field
* Any period of low acceleration noise in the vicinity of about 1 g
total acceleration probably indicates it has been set down on a
surface (or in the original scenario -- the car has come to a stop).

There other possibilities in other situations:
* Camera data can indicate relative motion
* Acoustical echoic signature and ambient sounds
* Wifi transmitter signal strengths
* 3G signal strengths. (Hey, I'm outdoors, maybe try GPS again!)
* Sonar!

A typical android device has more senses than humans. We synthesize an
understanding of our location and environment via a process of sensor
fusion. There's more opportunity for this sort of thing on Android
than Nintendo, as there's more processing power available and more
sensors to gather information -- especially when connected to a power
source or otherwise on a larger power budget than a cell phone. Look
at Dempster-Shafer Theory and Kahlman filters for techniques to handle
this sort of process.

On Jan 12, 5:10 pm, keyboardr  wrote:
> I know Nintendo originally tried to use accelerometers to figure out
> where it was pointing, and while that's theoretically possible, in
> practice the accuracy just isn't good enough.  The acceleration most
> of the time is small enough that even the slightest error will throw
> the whole calculation way off, and since you're relying on all of your
> previous results, errors get compounded over time.  That's why
> Nintendo switched to an IR camera setup.
>
> On Jan 12, 7:22 am, cellurl  wrote:
>
>
>
>
>
>
>
> > couldn't you use the accelerometer?
> > Integrate that? Use time. s=Integral(a  dt)
> > If that doesn't work, look to skyhook wireless!
> > -cellurl
>
> > On Jan 12, 8:20 am, Brill Pappin  wrote:
>
> > > Well you pretty much need distance traveled over time to find speed,
> > > so anything you can do to determine distance travelled should allow
> > > you to calculate the speed.
>
> > > For instance you could use cell tower location, but I wouldn't class
> > > it as even remotely accurate.
> > > If you want to give an actual real value, your going to need the
> > > accuracy of the GPS unit.
>
> > > - Brill Pappin
>
> > > On Jan 11, 11:13 pm, darrinps  wrote:
>
> > > > All the examples I see use GPS, and I have that working just fine but
> > > > I've noticed that every time I'm in a car, that unless the phone is
> > > > close to a window or the windshield the GPS does not work so...
>
> > > > I thought that there should be a way using course grained location
> > > > between cell towers. Does anyone know if this is possible and if so
> > > > might know where I could find some sample code please?
>
> > > > Thanks!
>
> > > > Darrin

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: EditText with Cross

2011-01-12 Thread Abhilash baddam
Hi,
   check the below link surely it will help you

http://androidsnips.blogspot.com/2010/10/create-edittext-with-cancel-button-as.html

On Thu, Jan 13, 2011 at 1:30 AM, Kumar Bibek  wrote:

> Well, it's possible, but it will be more complex. You have to give some
> padding in the edit text so that the button doesn't overlap the text on the
> edit text. And then, there might be focus problems. Another workaround is:
>
> Change the background of the edittext and the parent layout to whatever you
> want it to look like. And then have this layout.
>
> Parent Layout
> --Button-- --EditText--
>
> Code the listeners for the button, and it should work.
>
>
> Kumar Bibek
> http://techdroid.kbeanie.com
> http://www.kbeanie.com
>
>
>
> On Thu, Jan 13, 2011 at 1:23 AM, Richard Sámela wrote:
>
>> Yes that I know but I would like to do that the Button will be inside
>> of EdiText. The Button will be a little bit like a cover of EditText.
>> Is it possible to set the Button position to be above the EditText??
>> thanks for answering.
>>
>> On 12. Jan, 17:49 h., Kumar Bibek  wrote:
>> > It might just be a regular button beside the EditText. And I guess
>> that's
>> > very simple to implement.
>> >
>> > Kumar Bibekhttp://techdroid.kbeanie.comhttp://www.kbeanie.com
>> >
>> > On Wed, Jan 12, 2011 at 10:15 PM, Richard Sámela > >wrote:
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > > Hi,
>> > > I saw an app where was EditText and if you put some text into EditText
>> > > there was a Cross Button (or something like that) on the left side.
>> > > And if I click on this Button the text from EditText was deleted. Can
>> > > you help me or explain me how to to this? I would like to use EditText
>> > > with the same effect.
>> >
>> > > --
>> > > You received this message because you are subscribed to the Google
>> > > Groups "Android Developers" group.> To post to this group, send email
>> toandroid-develop...@googlegroups.com
>> > > To unsubscribe from this group, send email to>
>> android-developers+unsubscr...@googlegroups.com
>> 
>> >
>> > > For more options, visit this group at
>> > >http://groups.google.com/group/android-developers?hl=en
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to android-developers@googlegroups.com
>> To unsubscribe from this group, send email to
>> android-developers+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Minor ListView UI Issue

2011-01-12 Thread Paul
Hi all.  I have an app based on Notepad example app, and one thing
that 'bugs' me is that on insertion of a new note, the user can see
the new  item at the top of the ListView for a split second
before being taken to the EditText-based activity; I'd love for the
item to not be shown at all before the UI changes to the EditText
screen.

Looking at the EditText onCreate, I am calling setContentView() before
the note is inserted by the getContentResolver(), so trying to figure
out why the user can see the insert action of an Activity that is
called AFTER the view is set in onCreate of the activity... is this
due to simple lag between the time the setContentView() call happens
and the time the view can be expanded from XML?  Are views only
expanded at the end of onCreate, and thus this is happening after the
insert action by design?

Any information appreciated!

Paul

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] GestureActivity

2011-01-12 Thread naveen kumar
How to save gesture in sd card as a image.please help me . i want to
save gesture nonmutable file format.
thanks naveen

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: HttpURLConnection gives UnknownHostException

2011-01-12 Thread Ankur Avlani
Unfortunately, the server is not local.

On Wed, Jan 12, 2011 at 4:15 PM, Dan  wrote:

> Hello All,
>
> I have had this error both on emulator and a Motorola Droid while
> using a WIFI connection.  I have surrounded the http request with WIFI
> state checks and before and after WIFI is reported state 3
> (WIFI_STATE_ENABLED) and a connection speed of 54 . I have also
> confirmed, using an adb shell with the emulator, that the emulator
> cannot ping the website in question giving a domain resolution error.
> To compare notes with Ankur, is the server on your LAN and the IP used
> internal? mine is.
>
> I have also tried AndroidHttpClient which does work on the same url.
>
> -Dan
>
> On Jan 12, 12:23 pm, Ankur Avlani  wrote:
> > True, I agree with what you say.  Its just that I feel, other apps should
> > also break or give error.
> >
> > Anywayz, Thanks a lot for your inputs.
> >
> > regards,
> > Ankur.
> >
> >
> >
> >
> >
> >
> >
> > On Wed, Jan 12, 2011 at 12:17 PM, Brill Pappin  wrote:
> > > Well i suppose thats possible if your messing with the network stack,
> > > but it's pretty low level for Java/Android.
> > > I guess its also possible that the Android version you have has a
> > > crappy stack or driver... or you have rooted it and have been messing
> > > around under the covers so to speak.
> >
> > > There is nothing in Android really that would allow you to mess it up
> > > that badly AFAIK, so I doubt it's your application causing the problem
> > > if your not specifically getting under the covers.
> >
> > > However, the meaning of the exception is clear:
> >
> > >http://download.oracle.com/javase/1.4.2/docs/api/java/net/UnknownHost.
> ..
> > > and your app doesn't really control the process of translating a
> > > domain to an ip.
> >
> > > - Brill Pappin
> >
> > > On Jan 12, 2:54 pm, Ankur Avlani  wrote:
> > > > Somehow I have this feeling it is related to my app only.  Other apps
> on
> > > the
> > > > phone, I don't see any such issue.  Even when browsing on my phone, I
> > > don't
> > > > see any error.
> >
> > > > On Wed, Jan 12, 2011 at 11:41 AM, Kumar Bibek 
> > > wrote:
> > > > > By Wi-Fi, I meant, you phone's Wi-Fi could be turning on and off.
> There
> > > is
> > > > > no other reason I can think of. It happens for me as well,
> sometimes.
> >
> > > > > Kumar Bibek
> > > > >http://techdroid.kbeanie.com
> > > > >http://www.kbeanie.com
> >
> > > > > On Thu, Jan 13, 2011 at 1:10 AM, Ankur Avlani <
> ankuravl...@gmail.com
> > > >wrote:
> >
> > > > >> I am sorry, that somehow doesn't convince me.  I am connected to
> the
> > > same
> > > > >> wifi on my laptop and i never see any web page load error on my
> > > laptop.
> >
> > > > >> On Wed, Jan 12, 2011 at 11:38 AM, Kumar Bibek <
> coomar@gmail.com
> > > >wrote:
> >
> > > > >>> Yup, then it's a problem with your Wi-Fi.
> >
> > > > >>> Kumar Bibek
> > > > >>>http://techdroid.kbeanie.com
> > > > >>>http://www.kbeanie.com
> >
> > > > >>> On Thu, Jan 13, 2011 at 1:07 AM, Ankur Avlani <
> ankuravl...@gmail.com
> > > >wrote:
> >
> > > >  I am connected to network, I am on Wifi.  If i try again it
> works.
> > >  Its
> > > >  just random.
> >
> > > >  On Wed, Jan 12, 2011 at 11:34 AM, Kumar Bibek <
> coomar@gmail.com
> > > >wrote:
> >
> > > > > This error/exception comes because of no network connectivity.
> >
> > > > > Kumar Bibek
> > > > >http://techdroid.kbeanie.com
> > > > >http://www.kbeanie.com
> >
> > > > > On Thu, Jan 13, 2011 at 1:02 AM, Ankur Avlani <
> > > ankuravl...@gmail.com>wrote:
> >
> > > > >> Hi All,
> >
> > > > >> I am developing an application on Android.  I have seen that
> at
> > > times
> > > > >> when I try to connect using HttpURLConnection, for getting an
> > > Image or
> > > > >> anydata, I get the following error:
> >
> > > > >> 01-12 11:24:05.073: WARN/System.err(16780):
> > > > >> java.net.UnknownHostException: Host is unresolved:
> www.XXX.com:80.
> >
> > > > >> Note: I get this error on my Motorolla Droid and not in
> emulator.
> >
> > > > >> Any ideas?
> >
> > > > >> Thanks,
> > > > >> Ankur
> >
> > > > >>  --
> > > > >> 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 cr...@googlegroups.com> > > cr...@googlegroups.com>
> > > > >> For more options, visit this group at
> > > > >>http://groups.google.com/group/android-developers?hl=en
> >
> > > > >  --
> > > > > You received this message because you are subscribed to the
> Google
> > > > > Groups "Android Developers" group.
> > > > > To post to this group, send email to
> > > > > android-developers@googlegroups.com
> > > > > To unsubscribe from this group, s

[android-developers] Re: Anyone know how to calculate speed WITHOUT GPS?

2011-01-12 Thread ip332
You can get location from NETWORK_PROVIDER which can be calculated
from cell towers or WiFi AP.
The first one works almost always but the accuracy is not good
therefore you may get the same location for quite a long time.
All you need to do is to replace GPS_PROVIDER with NETWORK_PROVIDER.

On Jan 11, 8:13 pm, darrinps  wrote:
> All the examples I see use GPS, and I have that working just fine but
> I've noticed that every time I'm in a car, that unless the phone is
> close to a window or the windshield the GPS does not work so...
>
> I thought that there should be a way using course grained location
> between cell towers. Does anyone know if this is possible and if so
> might know where I could find some sample code please?
>
> Thanks!
>
> Darrin

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Anyone know how to calculate speed WITHOUT GPS?

2011-01-12 Thread Jake Basile
This cracked me up. Thank you sir.

On Wednesday, January 12, 2011 10:56:35 PM UTC-5, Spiral123 wrote:
>
> Play a tone and record it at the same time.  The doppler shift should 
> give you the speed.  Works for galaxies. 
>
> On Jan 12, 9:52 pm, metal mikey  wrote: 
> > You could use the phone's camera to take video of the car's 
> > speedometer and use image analysis to determine what the speedometer 
> > indicates the speed as. LOL :D

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Gingerbread BroadcastReceiver Issue

2011-01-12 Thread Jake Basile
I did some log searching, and found that this happens before the service 
stops working:
01-12 23:26:14.268: INFO/ActivityManager(109): No longer want 
com.jakebasile.android.hearingsaver (pid 31188): hidden #16
01-12 23:26:14.287: WARN/ActivityManager(109): Scheduling restart of crashed 
service com.jakebasile.android.hearingsaver/.RegistrationService in 5000ms
01-12 23:26:18.068: DEBUG/dalvikvm(496): GC_EXPLICIT freed 23K, 55% free 
3445K/7559K, external 1625K/2137K, paused 69ms
01-12 23:26:19.322: INFO/ActivityManager(109): Start proc 
com.jakebasile.android.hearingsaver for service 
com.jakebasile.android.hearingsaver/.RegistrationService: pid=31563 
uid=10064 gids={}

But afterwards, the service no longer works correctly. My onStartCommand 
isn't called, so the receiver doesn't get re-registered.

I don't understand why it would be a "crashed service". There is no error 
info being printed, and my code doesn't really *do* anything to cause a 
crash. Any ideas?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Cursor Position in EditText

2011-01-12 Thread Paul
Maybe more of an FYI than a question, but in playing around with
setSelection() with an EditText, it appears that:

- setting the position to anything above 0 works as expected, i.e.
mText.setSelection(3) puts the cursor at position three, but;
- setting the position to 0, i.e. the top-left position of the text,
fails, instead placing the cursor at the end of the first line of
text.

.setSelection(3):
Lorum ipsum...
^

.setSelection(0):
Lorum ipsum...
  ^

Anyone know of a way to have the cursor at position 0 when there is
existing text in the EditText, and maybe more importantly, any best
practices as to what a user would expect?  I have a large multi-line
EditText on a tablet, do I emulate Word and have the cursor at
position 0, or have the cursor at the end of line 1 as Android seems
to insist (which makes sense for a single-line EditText), or maybe at
the very end of the text, which could be way down on line n?  Having
the cursor at the end of line one of a multi-line entry seems to not
really help anyone.

Thanks for any thoughts,

Paul

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Anyone know how to calculate speed WITHOUT GPS?

2011-01-12 Thread Spiral123
Play a tone and record it at the same time.  The doppler shift should
give you the speed.  Works for galaxies.

On Jan 12, 9:52 pm, metal mikey  wrote:
> You could use the phone's camera to take video of the car's
> speedometer and use image analysis to determine what the speedometer
> indicates the speed as. LOL :D

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] SQLite database is puffed every time I run my app.

2011-01-12 Thread Kumar Bibek
You should change your Version of database to let it call the onUpgrade
method. Really, it should. And, the onCreate should not be called everytime.

It seems that your onUpgrade method is being called, and everytime you run
the app, it deletes all the tables and recreates them. That should explain
why your tables are empty. Check the logcat for more info. It should be
there.

Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.com



On Thu, Jan 13, 2011 at 5:22 AM, Tobiah  wrote:

> I took my code from the NotePad tutorial:
>
>private static class DatabaseHelper extends SQLiteOpenHelper {
>
>DatabaseHelper(Context context) {
>super(context, DATABASE_NAME, null,
> DATABASE_VERSION);
>}
>
>@Override
>public void onCreate(SQLiteDatabase db) {
>
>Log.e(TAG, "CREATING DAG");
>createDB(db);
>}
>
>@Override
>public void onUpgrade(SQLiteDatabase db, int oldVersion, int
> newVersion) {
>Log.e(TAG, "Upgrading database from version " +
> oldVersion + " to "
>+ newVersion + ", which will destroy
> all old data");
>
>db.execSQL("DROP TABLE IF EXISTS scan");
>db.execSQL("DROP TABLE IF EXISTS notes");
>db.execSQL("DROP TABLE IF EXISTS attendee");
>db.execSQL("DROP TABLE IF EXISTS
> attendeeqanswerlink");
>db.execSQL("DROP TABLE IF EXISTS lead");
>db.execSQL("DROP TABLE IF EXISTS leadnotes");
>db.execSQL("DROP TABLE IF EXISTS qanswer");
>db.execSQL("DROP TABLE IF EXISTS qquestion");
>db.execSQL("DROP TABLE IF EXISTS rolodex");
>db.execSQL("DROP TABLE IF EXISTS showinfo");
>
>onCreate(db);
>}
>}
>
> I can tell from the log that onCreate() is being called every time I start
> up my app.  onUpgrade() is not
> being called.  I can add data to the database using rawQuery().  While the
> app is running I can pull
> the database file to my dev box and select records from the copy.  If I
> restart the app, then pull
> the database, it's empty.
>
> What could be wrong?
>
> Thanks!
>
> Tobiah
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Listview is listing my items in reverse

2011-01-12 Thread Kumar Bibek
Are you using this?

http://developer.android.com/reference/android/widget/AbsListView.html#setStackFromBottom%28boolean%29

Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.com



On Thu, Jan 13, 2011 at 7:53 AM, kiros88  wrote:

> Hi I'm just wondering y this is happening bascially i have a
> arrayadapter that prints out a array of strings in a listview  btu
> iono why for some reason the list printout is in reverse like the list
> is starting from the bottom of the screen going up um? im not sure
> where to check i dont really have any line of code that states doing
> this but i want the list going from the top -down so does anyone have
> an idea
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] strong BlurMaskFilter

2011-01-12 Thread Rob Truxler
Hi everyone.  I'm doing some custom rendering on a Canvas object, and want
to achieve a visible white glow behind some text. I'm using a Paint object
with a BlurMaskFilter:

Paint p = new Paint();
p.setColor(0x);
p.setMaskFilter(new BlurMaskFilter(4f,BlurMaskFilter.Blur.OUTER));

I can see the blur, but it is very very faint. Is there any way to beef up
the alpha values? I tried rendering with this paint object multiple times
and this does make the glow easier to see, but it makes for inefficient
rendering.

Thanks, Rob

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Sharing data between apps

2011-01-12 Thread Dianne Hackborn
Your apps are in two different sandboxes.  They are protected from
themselves, just like they are protected from other apps.  That's the way it
is.

SharedPreferences doesn't mean a big data pool that all of the applications
installed on the device share.  It is just shared amongst the components of
an app.

You've been given the 4 main components used for interaction between two
apps.  10 bytes is pretty small, so any of those will be totally sufficient
to get 10 bytes from here to there.  Just use one of them.  A broadcast
receiver is probably the easiest.

On Wed, Jan 12, 2011 at 5:35 PM, John Lussmyer wrote:

>
>
> On Wed, Jan 12, 2011 at 4:53 PM, Mark Murphy wrote:
>
>> On Wed, Jan 12, 2011 at 5:58 PM, John Lussmyer 
>> wrote:
>> > 3) Internal Storage - separate apps can't write to each others area,
>> even if they have the same userid.
>>
>> AFAIK, they can. What proof do you have to the contrary? Not that this
>> is particularly a good strategy for SDK apps, mind you.
>>
>
>
> You can't specify a path in the call to openFileOutput().  (Fails if there
> are any path separators)
> Hard to specify another apps directory if you can't use path separators.
>
>
>
>>
>> > So, in order to send 10 bytes of data to another app, it seems that I'll
>> > have to create a new Activity and have it respond to an Intent().
>>
>> That is not the proper use of an Activity.
>>
>> > Is that really the only way to do this?
>>
>> -- Create a service, exposing an API through AIDL, consumed via
>> bindService()
>>
>> -- Create a service, exposing an API through an Intent (sent via
>> startService()) and returning results via a Messenger, or
>> createPendingResult()'s PendingIntent, etc.
>>
>> -- Create a content provider
>>
>> There may be other options depending on what the "10 bytes of data"
>> actually is, but those should get you started.
>>
>>
> 10 bytes of data is 10 bytes of data.  10 binary bytes.  Not text.
> Only needs to be transferred occasionally, but does need to be transferred.
>
> So, what you are saying is there is NO easy way to transfer a tiny bit of
> data.
> App X just needs to send it to App Y when the user does certain actions.
> sigh.
> (In this case there are 2 apps, either of which can be used independently,
> but if both are on the phone, they can work together.)
>
> A SharedPreference would have been perfect - but the "Shared" prefix seems
> to have a different meaning than what you would think.
>
>
>
>  --
> 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
>



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Comparing values afterTextChanged

2011-01-12 Thread Bob Kerns
Um, no -- you're trying to make a good point, but it ends up being bad
advice, because you hit it with too big a hammer... I'm glad you
tried, though.

You really MUST use == when == is the right thing -- and must not use
it otherwise. Primitives are just one case. It's important to
understand what == does, and what .equals() does.

As you note, comparing two strings, say, with == simply compares that
they're physically the same object. This isn't very likely to be
useful for strings. Since they're immutable, one string is generally
as good as another, so long as they contain the right characters.

However -- if your question is "if I modify this object reference,
will that affect that object reference?", then equals() is the WRONG
question to ask.

One way to look at it is .equals() asks about equivalence, while ==,
when applied to an object (rather than a primitive) asks about
identity.

Now, it's reasonable to ask whether you should ever have equals()
return true and == return false in any case when identity might
matter.  In general, I would suggest avoiding that, just on the
grounds of potential confusion. equals() implies a type of
equivalence, while if the identity matters (say, because of instance
state not compared in the equals() method, that says they're not fully
equivalent.

But there often is more than one notion of equivalence at work in a
system. For example, equals() may be defined for supporting use as a
key in a hash table, and thus must consider only immutable fields.

And even if they would both return the same answer, it is better to
use == when that is, in fact, what you are asking. Using equal() on a
mutable instance when you care about identity is itself misleading and
confusing.

If you want to capture this in a short phrase, I'd suggest "same
object (==) vs same content (equals())". Where "same content" means
whatever equals() defines it to mean.

On Jan 12, 2:35 pm, H  wrote:
> No worries.
>
> I should probably clarify a bit by saying that you should only really use
> the "==" when comparing primitives. For non primitives (e.g. any Object
> class - basically anything that starts with a capital letter), most of the
> time, you are probably wanting to use .equals.
>
> Remember that the .equals class can be overriden on any class so some
> classes can customise and choose exactly how to test for equality. If you
> use the "==" then you have no choice in how that test is run other than the
> default way which compares the memory references.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Calculating screen coordiantes in augmented reality???

2011-01-12 Thread prachi
Hi

Yeah Im getting the coordinates but they are always jumping on the
screenIs something to do with remapCoordinatesystem method for
landscape mode...bcozzz i hav set the oreintation of my camera as
landscape mode...

If smbdyy can guide me with the correct approach of how to start with
augmented reality browse

On Jan 12, 7:14 pm, JP  wrote:
> On Jan 12, 2:59 am, prachi  wrote:
>
>
>
>
>
> > Hi
>
> > Iam developing an augmented reality browser on my ownn...But
> > not able to get the screen cooridinates
>
> > I will discuss my whole problem here.as im not sure at which point
> > i stuck up...
>
> > I hav a set of latitude longitude values for different points.Taking
> > them Iam calculating x,y,z coordinates for each point.Using left
> > handed rule ie.x towards east y towards north and z upwards
> > values which i get are:-
>
> > x=(a+altitude)*(Math.cos(latitude)*Math.sin(longitude));//x
> > y=(a+altitude)*Math.sin(latitude);//y
> > z=(a+altitude)*(Math.cos(latitude)*Math.cos(longitude));//z
>
> > where a=app 80m i have taken radius of earth.The origin is defined to
> > be at centre of earth(ECEF)
>
> > SensorManager.getRotationMatrix(RTmp, I, grav, mag);
> >                 SensorManager.remapCoordinateSystem(RTmp, 
> > SensorManager.AXIS_X,
> > SensorManager.AXIS_Z, R);
> >                 SensorManager.getOrientation(R, values);
> >                 azimuth = (float)((values[0])*(180/Math.PI)); //in degree
> >                 pitch = (float)((values[1])*(180/Math.PI)); //in degree
> >                 roll = (float)((values[2])*(180/Math.PI)); //in degree
>
> > Then using perspective projection Iam calculating screen coordinates.
> > Iam refering below link for perspective projection:--
>
> >http://en.wikipedia.org/wiki/3D_projection#Perspective_projection
>
> > In the above link Iam replacing thetax with pitch,thetay with
> > roll,thetaz with azimuth.
>
> > Watever screen coordinates i got from above calculations Iam plotting
> > a circle using canvas.But Iam unable to see anything.
>
> > Pleae help as Iam stuck up with this for the past 3 dayzzz :( :(
>
> Hard to give a direct answer from that far. Did you fire up the
> debugger and check the coordinate values you get? If they "hit" the
> screen and you do not "see anything", the problem is some place else,
> drawing the overlay. (This doesn't mean you've necessarily got the
> math right, but at least it's a start).- Hide quoted text -
>
> - Show quoted text -

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] import! global roaming

2011-01-12 Thread herry
hi,
all, i got a problem: when i want to figure out if the device is in
global roaming or just national roaming , i found that : android only
give a confused answer in TelephonyManager(isNetworkRoaming()),but i
need more information.

any help is grateful.

thx.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: sqllite

2011-01-12 Thread DanH
If you want the exact string you say , in effect:

COLUMN_NAME = 'my search string'

(single quotes)

On Jan 12, 7:07 pm, "Hendrik Greving"  wrote:
> KEY_STRING is the text column name
>
> When putting in KEY_STRING + " like " + mystring => I am getting a syntax 
> exception
> KEY_STRING + " like \"" + mystring + "\"" => it seems to incorrectly always 
> find something
>
> Actually, I want only exact matches, no substrings anyways
>
>   - Original Message -
>   From: Kostya Vasilyev
>   To: android-developers@googlegroups.com
>   Sent: Wednesday, January 12, 2011 4:51 PM
>   Subject: Re: [android-developers] sqllite
>
>   Try using "like":
>
>   ... where column like "%substring%"...
>
>   --
>   Kostya Vasilyev --http://kmansoft.wordpress.com
>
>   13.01.2011 3:42 пользователь "Hendrik Greving"  
> написал:
>   > I have a database with a primary integer row key and several columns. One 
> of the columns is "text". Normally I am only fetching for the key, which is 
> easy with SQLiteDataBase.query and KEY_ROWID =  in the selection 
> field. How can I check whether a row (or more) exist that contain a certain 
> string in the text column. I've tried "MY_STRING_COLUMN = 
> \"my_search_string\"" in the selection argument, but this doesn't work.
>
>   > --
>   > You received this message because you are subscribed to the Google
>   > Groups "Android Developers" group.
>   > To post to this group, send email to android-developers@googlegroups.com
>   > To unsubscribe from this group, send email to
>   > android-developers+unsubscr...@googlegroups.com
>   > For more options, visit this group at
>   >http://groups.google.com/group/android-developers?hl=en
>
>   --
>   You received this message because you are subscribed to the Google
>   Groups "Android Developers" group.
>   To post to this group, send email to android-developers@googlegroups.com
>   To unsubscribe from this group, send email to
>   android-developers+unsubscr...@googlegroups.com
>   For more options, visit this group at
>  http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Anyone know how to calculate speed WITHOUT GPS?

2011-01-12 Thread metal mikey
You could use the phone's camera to take video of the car's
speedometer and use image analysis to determine what the speedometer
indicates the speed as. LOL :D

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Sharing data between apps

2011-01-12 Thread John Lussmyer
On Wed, Jan 12, 2011 at 6:18 PM, Mark Murphy wrote:

> On Wed, Jan 12, 2011 at 8:35 PM, John Lussmyer 
> wrote:>
> > 10 bytes of data is 10 bytes of data.
>
> Not really, but you are certainly welcome to your opinion.
>


Now this has me curious.  What definitions of data would make a difference?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: I ask for power off but get reboot instead sometimes

2011-01-12 Thread metal mikey
@TreKing: I feel your paaain! As an early adopter/enthusiat residing
in Australia, I get the added pain of having had my NexusOne
personalised (so a replacement is not an option), HTC support based in
USA, taking calls only around USA business hours, and issuing FedEx
mailing instructions that are only valid for 7 days (hence I saw fit
to not even try to send it over before Christmas). Fun times :/

As for turning it on, there is the trick you can employ whereby you
hook USB power to your NexusOne and then "trash" the battery in and
out until the phone gets duped into powering on. Make sure to quickly
change your settings so the display doesn't sleep, because that power
button is also the only way to wake it up.

Given that the power button is a major failing point of the NexusOne,
I think it would be very, very nice of Google to provide an official
update for the NexusOne that allows an alternate means of waking the
phone up (i.e. via the trackball button), as then my phone could be
safely taken off "life support" (i.e. the usb power connection).

On Jan 13, 12:14 pm, TreKing  wrote:
> On Wed, Jan 12, 2011 at 6:29 PM, metal mikey  wrote:
> > you're lucky you can even use your power button! (I can't
>
> LOL, that's exactly my newest problem! Kinda hard to use the phone when it
> won't turn on.
>
> -
> TreKing  - Chicago
> transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Listview is listing my items in reverse

2011-01-12 Thread kiros88
Hi I'm just wondering y this is happening bascially i have a
arrayadapter that prints out a array of strings in a listview  btu
iono why for some reason the list printout is in reverse like the list
is starting from the bottom of the screen going up um? im not sure
where to check i dont really have any line of code that states doing
this but i want the list going from the top -down so does anyone have
an idea

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Can't find Activity error

2011-01-12 Thread John Lussmyer
Should they?
And which ones are you talking about?

On Wed, Jan 12, 2011 at 5:22 PM, Stephen Jungels  wrote:

> Unless your android:name elements are fully qualified, they should
> begin with a period, should they not?
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Sharing data between apps

2011-01-12 Thread Mark Murphy
On Wed, Jan 12, 2011 at 8:35 PM, John Lussmyer  wrote:
> You can't specify a path in the call to openFileOutput().

Don't use openFileOutput(), then.

> Hard to specify another apps directory if you can't use path separators.

You can use path separators in Android. You just cannot use path
separators in openFileOutput(). That's one reason why I don't use
openFileOutput(). Just use standard Java I/O.

>> There may be other options depending on what the "10 bytes of data"
>> actually is, but those should get you started.
>>
>
> 10 bytes of data is 10 bytes of data.

Not really, but you are certainly welcome to your opinion.

> App X just needs to send it to App Y when the user does certain actions.

Use a broadcast Intent and a BroadcastReceiver. Or any of the
approaches I mentioned earlier.

> A SharedPreference would have been perfect - but the "Shared" prefix seems
> to have a different meaning than what you would think.

They are shared among components in an app. They are not shared
between applications, between devices, between neighboring countries,
or between consenting adults.

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

Android App Developer Books: http://commonsware.com/books

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Sharing data between apps

2011-01-12 Thread John Lussmyer
On Wed, Jan 12, 2011 at 4:53 PM, Mark Murphy wrote:

> On Wed, Jan 12, 2011 at 5:58 PM, John Lussmyer 
> wrote:
> > 3) Internal Storage - separate apps can't write to each others area, even
> if they have the same userid.
>
> AFAIK, they can. What proof do you have to the contrary? Not that this
> is particularly a good strategy for SDK apps, mind you.
>


You can't specify a path in the call to openFileOutput().  (Fails if there
are any path separators)
Hard to specify another apps directory if you can't use path separators.



>
> > So, in order to send 10 bytes of data to another app, it seems that I'll
> > have to create a new Activity and have it respond to an Intent().
>
> That is not the proper use of an Activity.
>
> > Is that really the only way to do this?
>
> -- Create a service, exposing an API through AIDL, consumed via
> bindService()
>
> -- Create a service, exposing an API through an Intent (sent via
> startService()) and returning results via a Messenger, or
> createPendingResult()'s PendingIntent, etc.
>
> -- Create a content provider
>
> There may be other options depending on what the "10 bytes of data"
> actually is, but those should get you started.
>
>
10 bytes of data is 10 bytes of data.  10 binary bytes.  Not text.
Only needs to be transferred occasionally, but does need to be transferred.

So, what you are saying is there is NO easy way to transfer a tiny bit of
data.
App X just needs to send it to App Y when the user does certain actions.
sigh.
(In this case there are 2 apps, either of which can be used independently,
but if both are on the phone, they can work together.)

A SharedPreference would have been perfect - but the "Shared" prefix seems
to have a different meaning than what you would think.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Can't find Activity error

2011-01-12 Thread Stephen Jungels
Unless your android:name elements are fully qualified, they should
begin with a period, should they not?

On Wed, Jan 12, 2011 at 8:05 PM, John Lussmyer  wrote:
> Didn't help.
>
> On Wed, Jan 12, 2011 at 4:59 PM, Mark Murphy 
> wrote:
>>
>> I'd get rid of the setPackage() call.
>>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Sharing data between apps

2011-01-12 Thread Mark Murphy
On Wed, Jan 12, 2011 at 5:58 PM, John Lussmyer  wrote:
> 3) Internal Storage - separate apps can't write to each others area, even if 
> they have the same userid.

AFAIK, they can. What proof do you have to the contrary? Not that this
is particularly a good strategy for SDK apps, mind you.

> So, in order to send 10 bytes of data to another app, it seems that I'll
> have to create a new Activity and have it respond to an Intent().

That is not the proper use of an Activity.

> Is that really the only way to do this?

-- Create a service, exposing an API through AIDL, consumed via bindService()

-- Create a service, exposing an API through an Intent (sent via
startService()) and returning results via a Messenger, or
createPendingResult()'s PendingIntent, etc.

-- Create a content provider

There may be other options depending on what the "10 bytes of data"
actually is, but those should get you started.

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

Android App Developer Books: http://commonsware.com/books

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: I ask for power off but get reboot instead sometimes

2011-01-12 Thread TreKing
On Wed, Jan 12, 2011 at 6:29 PM, metal mikey  wrote:

> you're lucky you can even use your power button! (I can't
>

LOL, that's exactly my newest problem! Kinda hard to use the phone when it
won't turn on.

-
TreKing  - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Anyone know how to calculate speed WITHOUT GPS?

2011-01-12 Thread keyboardr
I know Nintendo originally tried to use accelerometers to figure out
where it was pointing, and while that's theoretically possible, in
practice the accuracy just isn't good enough.  The acceleration most
of the time is small enough that even the slightest error will throw
the whole calculation way off, and since you're relying on all of your
previous results, errors get compounded over time.  That's why
Nintendo switched to an IR camera setup.

On Jan 12, 7:22 am, cellurl  wrote:
> couldn't you use the accelerometer?
> Integrate that? Use time. s=Integral(a  dt)
> If that doesn't work, look to skyhook wireless!
> -cellurl
>
> On Jan 12, 8:20 am, Brill Pappin  wrote:
>
>
>
>
>
>
>
> > Well you pretty much need distance traveled over time to find speed,
> > so anything you can do to determine distance travelled should allow
> > you to calculate the speed.
>
> > For instance you could use cell tower location, but I wouldn't class
> > it as even remotely accurate.
> > If you want to give an actual real value, your going to need the
> > accuracy of the GPS unit.
>
> > - Brill Pappin
>
> > On Jan 11, 11:13 pm, darrinps  wrote:
>
> > > All the examples I see use GPS, and I have that working just fine but
> > > I've noticed that every time I'm in a car, that unless the phone is
> > > close to a window or the windshield the GPS does not work so...
>
> > > I thought that there should be a way using course grained location
> > > between cell towers. Does anyone know if this is possible and if so
> > > might know where I could find some sample code please?
>
> > > Thanks!
>
> > > Darrin

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Can't find Activity error

2011-01-12 Thread John Lussmyer
Didn't help.

On Wed, Jan 12, 2011 at 4:59 PM, Mark Murphy wrote:

> I'd get rid of the setPackage() call.
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] sqllite

2011-01-12 Thread Hendrik Greving
KEY_STRING is the text column name

When putting in KEY_STRING + " like " + mystring => I am getting a syntax 
exception
KEY_STRING + " like \"" + mystring + "\"" => it seems to incorrectly always 
find something

Actually, I want only exact matches, no substrings anyways
  - Original Message - 
  From: Kostya Vasilyev 
  To: android-developers@googlegroups.com 
  Sent: Wednesday, January 12, 2011 4:51 PM
  Subject: Re: [android-developers] sqllite


  Try using "like":

  ... where column like "%substring%"...


  --
  Kostya Vasilyev -- http://kmansoft.wordpress.com

  13.01.2011 3:42 пользователь "Hendrik Greving"  
написал:
  > I have a database with a primary integer row key and several columns. One 
of the columns is "text". Normally I am only fetching for the key, which is 
easy with SQLiteDataBase.query and KEY_ROWID =  in the selection 
field. How can I check whether a row (or more) exist that contain a certain 
string in the text column. I've tried "MY_STRING_COLUMN = \"my_search_string\"" 
in the selection argument, but this doesn't work.
  > 
  > -- 
  > You received this message because you are subscribed to the Google
  > Groups "Android Developers" group.
  > To post to this group, send email to android-developers@googlegroups.com
  > To unsubscribe from this group, send email to
  > android-developers+unsubscr...@googlegroups.com
  > For more options, visit this group at
  > http://groups.google.com/group/android-developers?hl=en


  -- 
  You received this message because you are subscribed to the Google
  Groups "Android Developers" group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: HttpURLConnection gives UnknownHostException

2011-01-12 Thread Dan
I have tried a more extensive test with AndroidHttpClient and received
an error:

01-12 16:58:31.614: WARN/System.err(1953):
java.net.UnknownHostException: cs.wirelsswerx-test.com
01-12 16:58:31.614: WARN/System.err(1953): at
java.net.InetAddress.lookupHostByName(InetAddress.java:504)
01-12 16:58:31.622: WARN/System.err(1953): at
java.net.InetAddress.getAllByNameImpl(InetAddress.java:278)
01-12 16:58:31.630: WARN/System.err(1953): at
java.net.InetAddress.getAllByName(InetAddress.java:242)
01-12 16:58:31.630: WARN/System.err(1953): at
org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:
136)
01-12 16:58:31.630: WARN/System.err(1953): at
org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:
164)
01-12 16:58:31.630: WARN/System.err(1953): at
org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:
119)
01-12 16:58:31.638: WARN/System.err(1953): at
org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:
348)
01-12 16:58:31.638: WARN/System.err(1953): at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:
555)
01-12 16:58:31.638: WARN/System.err(1953): at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:
487)
01-12 16:58:31.638: WARN/System.err(1953): at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:
465)
01-12 16:58:31.646: WARN/System.err(1953): at
android.net.http.AndroidHttpClient.execute(AndroidHttpClient.java:243)

Proprietary portion of stack trace snipped.

On Jan 12, 4:15 pm, Dan  wrote:
> Hello All,
>
> I have had this error both on emulator and a Motorola Droid while
> using a WIFI connection.  I have surrounded the http request with WIFI
> state checks and before and after WIFI is reported state 3
> (WIFI_STATE_ENABLED) and a connection speed of 54 . I have also
> confirmed, using an adb shell with the emulator, that the emulator
> cannot ping the website in question giving a domain resolution error.
> To compare notes with Ankur, is the server on your LAN and the IP used
> internal? mine is.
>
> I have also tried AndroidHttpClient which does work on the same url.
>
> -Dan
>
> On Jan 12, 12:23 pm, Ankur Avlani  wrote:
>
>
>
>
>
>
>
> > True, I agree with what you say.  Its just that I feel, other apps should
> > also break or give error.
>
> > Anywayz, Thanks a lot for your inputs.
>
> > regards,
> > Ankur.
>
> > On Wed, Jan 12, 2011 at 12:17 PM, Brill Pappin  wrote:
> > > Well i suppose thats possible if your messing with the network stack,
> > > but it's pretty low level for Java/Android.
> > > I guess its also possible that the Android version you have has a
> > > crappy stack or driver... or you have rooted it and have been messing
> > > around under the covers so to speak.
>
> > > There is nothing in Android really that would allow you to mess it up
> > > that badly AFAIK, so I doubt it's your application causing the problem
> > > if your not specifically getting under the covers.
>
> > > However, the meaning of the exception is clear:
>
> > >http://download.oracle.com/javase/1.4.2/docs/api/java/net/UnknownHost...
> > > and your app doesn't really control the process of translating a
> > > domain to an ip.
>
> > > - Brill Pappin
>
> > > On Jan 12, 2:54 pm, Ankur Avlani  wrote:
> > > > Somehow I have this feeling it is related to my app only.  Other apps on
> > > the
> > > > phone, I don't see any such issue.  Even when browsing on my phone, I
> > > don't
> > > > see any error.
>
> > > > On Wed, Jan 12, 2011 at 11:41 AM, Kumar Bibek 
> > > wrote:
> > > > > By Wi-Fi, I meant, you phone's Wi-Fi could be turning on and off. 
> > > > > There
> > > is
> > > > > no other reason I can think of. It happens for me as well, sometimes.
>
> > > > > Kumar Bibek
> > > > >http://techdroid.kbeanie.com
> > > > >http://www.kbeanie.com
>
> > > > > On Thu, Jan 13, 2011 at 1:10 AM, Ankur Avlani  > > >wrote:
>
> > > > >> I am sorry, that somehow doesn't convince me.  I am connected to the
> > > same
> > > > >> wifi on my laptop and i never see any web page load error on my
> > > laptop.
>
> > > > >> On Wed, Jan 12, 2011 at 11:38 AM, Kumar Bibek  > > >wrote:
>
> > > > >>> Yup, then it's a problem with your Wi-Fi.
>
> > > > >>> Kumar Bibek
> > > > >>>http://techdroid.kbeanie.com
> > > > >>>http://www.kbeanie.com
>
> > > > >>> On Thu, Jan 13, 2011 at 1:07 AM, Ankur Avlani  > > >wrote:
>
> > > >  I am connected to network, I am on Wifi.  If i try again it works.
> > >  Its
> > > >  just random.
>
> > > >  On Wed, Jan 12, 2011 at 11:34 AM, Kumar Bibek  > > >wrote:
>
> > > > > This error/exception comes because of no network connectivity.
>
> > > > > Kumar Bibek
> > > > >http://techdroid.kbeanie.com
> > > > >http://www.kbeanie.com
>
> > > > > On Thu, Jan 13, 2011 at 1:02 AM, Ankur Avlani <
> > > ankuravl...@gmail.com>wro

Re: [android-developers] Can't find Activity error

2011-01-12 Thread Mark Murphy
I'd get rid of the setPackage() call.

On Wed, Jan 12, 2011 at 7:55 PM, John Lussmyer  wrote:
> So, I modified the manifest to have:
>
>             
>                                      android:name="com.casadelgato.lifewallpaper.UPDATEPREFS"
> />
>                                      android:name="android.intent.category.CATEGORY_DEFAULT"
> />
>             
>
> Made no difference.
>
> 2011/1/12 Kostya Vasilyev 
>>
>> You need category_default in the intent filter of your activity for launch
>> by action string to work.
>>
>> --
>
> --
> 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



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

Android App Developer Books: http://commonsware.com/books

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Can't find Activity error

2011-01-12 Thread John Lussmyer
So, I modified the manifest to have:






Made no difference.

2011/1/12 Kostya Vasilyev 

> You need category_default in the intent filter of your activity for launch
> by action string to work.
>
> --
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] sqllite

2011-01-12 Thread Kostya Vasilyev
Try using "like":

... where column like "%substring%"...

--
Kostya Vasilyev -- http://kmansoft.wordpress.com
13.01.2011 3:42 пользователь "Hendrik Greving" 
написал:
> I have a database with a primary integer row key and several columns. One
of the columns is "text". Normally I am only fetching for the key, which is
easy with SQLiteDataBase.query and KEY_ROWID =  in the selection
field. How can I check whether a row (or more) exist that contain a certain
string in the text column. I've tried "MY_STRING_COLUMN =
\"my_search_string\"" in the selection argument, but this doesn't work.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Can't find Activity error

2011-01-12 Thread Kostya Vasilyev
You need category_default in the intent filter of your activity for launch
by action string to work.

--
Kostya Vasilyev -- http://kmansoft.wordpress.com
13.01.2011 2:46 пользователь "John Lussmyer" 
написал:
> I'm trying to use an Intent() to send a little data to another app.
> So far, I've been unable to get the startActivity() to succeed. It always
> fails with a ActivityNotFound exception.
> I just haven't been able to figure out WHY my activity isn't being found.
>
> invoking code is:
>
> Intent intent = new
> Intent("com.casadelgato.lifewallpaper.UPDATEPREFS");
> intent.setPackage("com.casadelgato.lifewallpaper");
> intent.putExtra("PrefUpdate", true);
> startActivity(intent);
>
>
> Manifest of target app is:
>
> 
>  xmlns:android="http://schemas.android.com/apk/res/android";
> package="com.casadelgato.lifewallpaper"
> android:versionName="1.0.3"
> android:versionCode="4"
> android:sharedUserId="@string/SharedUserID">
>  android:minSdkVersion="7" />
>  android:name="android.software.live_wallpaper"
> android:required="true" />
>  android:icon="@drawable/icon"
> android:label="@string/app_name"
> android:process="@string/SharedUserID">
>
>  android:label="@string/servicelabel"
> android:permission="android.permission.BIND_WALLPAPER"
> android:name="LifeWallpaper"
> android:enabled="true">
> 
> 
> android:name="android.service.wallpaper.WallpaperService" />
> 
>  android:name="android.service.wallpaper"
> android:resource="@xml/settingsconfig" />
> 
>  android:label="Life Wallpaper Settings"
> android:theme="@android:style/Theme.Light.WallpaperSettings"
> android:exported="true"
> android:enabled="true"
> android:name="LifeSettings">
> 
>  android:name="com.casadelgato.lifewallpaper.UPDATEPREFS"
> />
> 
> 
>
> 
>
>
> 
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Sharing data between apps

2011-01-12 Thread Dianne Hackborn
Activity, BroadcastReceiver, ContentProvider, or Service.

On Wed, Jan 12, 2011 at 2:58 PM, John Lussmyer wrote:

> I've been looking to see if there is a relatively simple way for 2 apps to
> share a tiny bit of data.
> So far, I haven't found any.
>
> 1) SharedPreferences - aren't shared.
> 2) MemoryFile in Shared Memory - there appears to be no way to share these
> between apps.
> 3) Internal Storage - separate apps can't write to each others area, even
> if they have the same userid.
> 4) External storage - may not exist.
>
> So, in order to send 10 bytes of data to another app, it seems that I'll
> have to create a new Activity and have it respond to an Intent().
> Is that really the only way to do this?
>
>  --
> 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




-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] sqllite

2011-01-12 Thread Hendrik Greving
I have a database with a primary integer row key and several columns. One of 
the columns is "text". Normally I am only fetching for the key, which is easy 
with SQLiteDataBase.query and KEY_ROWID =  in the selection field. 
How can I check whether a row (or more) exist that contain a certain string in 
the text column. I've tried "MY_STRING_COLUMN = \"my_search_string\"" in the 
selection argument, but this doesn't work.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Sharing data between apps

2011-01-12 Thread John Lussmyer
I've been looking to see if there is a relatively simple way for 2 apps to
share a tiny bit of data.
So far, I haven't found any.

1) SharedPreferences - aren't shared.
2) MemoryFile in Shared Memory - there appears to be no way to share these
between apps.
3) Internal Storage - separate apps can't write to each others area, even if
they have the same userid.
4) External storage - may not exist.

So, in order to send 10 bytes of data to another app, it seems that I'll
have to create a new Activity and have it respond to an Intent().
Is that really the only way to do this?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: clicking a link on a website launches my application...

2011-01-12 Thread sdphil
that sample was great except that it doesn't show what the link the
web site looks like.  I assume it looks like what I have.  The problem
is that the browser is trying to redirect when I click on it instead
of giving the intent to my app.

On Jan 7, 2:11 pm, Mark Murphy  wrote:
> FWIW, here is a sample project showing some of this stuff in action
> (though not using myproto):
>
> https://github.com/commonsguy/cw-advandroid/tree/master/Introspection...
>
>
>
> On Fri, Jan 7, 2011 at 5:08 PM, sdphil  wrote:
> > so  you mean like this?
>
> >            
> >                
> >                 > android:name="android.intent.category.DEFAULT"/>
> >                
> >            
>
> > this gives the same thing...
>
> > On Jan 7, 1:59 pm, TreKing  wrote:
> >> On Fri, Jan 7, 2011 at 3:55 PM, sdphil  wrote:
> >> > so, what am I doing wrong?
>
> >> The browser will not be launching an intent with that action. Your action
> >> should probably be "ACTION_VIEW".
>
> >> -
> >> 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
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> _The Busy Coder's Guide to Android Development_ Version 3.4 Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: I ask for power off but get reboot instead sometimes

2011-01-12 Thread metal mikey
Yep, NexusOne is great an all but sucks on a few levels...you're lucky
you can even use your power button! (I can't, it failed on the day I
was attending the Google Developer Lab...coincidence?)

Anyways, this isn't a NexusOne support mailing list..this list is for
Android Developers.

On Jan 13, 10:15 am, TreKing  wrote:
> On Wed, Jan 12, 2011 at 4:01 PM, higonnet  wrote:
> > I find this disconcerting at best, since the reason I'm powering the thing
> > off is that it isn't behaving the way it usually does...
>
> http://www.htc.com/www/support/nexusone/
>
> I'm sending in my second replacement tonight. Nice phone but sure is
> brittle.
>
> -
> TreKing  - Chicago
> transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: (Unknown) contact showing up after a modify

2011-01-12 Thread Simon MacDonald
Sorry all, there was a newInsert() as part of the larger function that
was causing this problem.

Simon Mac Donald
http://hi.im/simonmacdonald



On Wed, Jan 12, 2011 at 5:28 PM, Simon MacDonald
 wrote:
> Hi all,
>
> I have a weird issue on an Android 2.2 device.  I have an existing
> contact and I do a modify operation on it via:
>
> ContentProviderOperation.Builder builder =
> ContentProviderOperation.newUpdate(ContactsContract.Data.CONTENT_URI)
>        .withSelection(ContactsContract.Data.CONTACT_ID + "=? AND " +
>        ContactsContract.Data.MIMETYPE + "=?",
>        new String[]{id,
> ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE})
>        
> .withValue(ContactsContract.CommonDataKinds.StructuredName.DISPLAY_NAME,
> displayName)
>        .withValue(ContactsContract.CommonDataKinds.StructuredName.FAMILY_NAME,
> familyName)
>        .withValue(ContactsContract.CommonDataKinds.StructuredName.MIDDLE_NAME,
> middleName)
>        .withValue(ContactsContract.CommonDataKinds.StructuredName.GIVEN_NAME,
> givenName)
>        .withValue(ContactsContract.CommonDataKinds.StructuredName.PREFIX,
> honorificPrefix)
>        .withValue(ContactsContract.CommonDataKinds.StructuredName.SUFFIX,
> honorificSuffix);
>
> mApp.getContentResolver().applyBatch(ContactsContract.AUTHORITY, ops);
>
> The contact gets modified correctly.  All of the new values show up
> for the Contacts name.
>
> However, if I look in my Contacts app there is a new contact called
> "(Unknown)" that shows up after I do a modify.  I can insert as many
> contacts as I want but every modify creates a new "(Unknown)" contact.
>
> Anyone have any ideas?
>
> Simon Mac Donald
> http://hi.im/simonmacdonald
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: HttpURLConnection gives UnknownHostException

2011-01-12 Thread Dan
Hello All,

I have had this error both on emulator and a Motorola Droid while
using a WIFI connection.  I have surrounded the http request with WIFI
state checks and before and after WIFI is reported state 3
(WIFI_STATE_ENABLED) and a connection speed of 54 . I have also
confirmed, using an adb shell with the emulator, that the emulator
cannot ping the website in question giving a domain resolution error.
To compare notes with Ankur, is the server on your LAN and the IP used
internal? mine is.

I have also tried AndroidHttpClient which does work on the same url.

-Dan

On Jan 12, 12:23 pm, Ankur Avlani  wrote:
> True, I agree with what you say.  Its just that I feel, other apps should
> also break or give error.
>
> Anywayz, Thanks a lot for your inputs.
>
> regards,
> Ankur.
>
>
>
>
>
>
>
> On Wed, Jan 12, 2011 at 12:17 PM, Brill Pappin  wrote:
> > Well i suppose thats possible if your messing with the network stack,
> > but it's pretty low level for Java/Android.
> > I guess its also possible that the Android version you have has a
> > crappy stack or driver... or you have rooted it and have been messing
> > around under the covers so to speak.
>
> > There is nothing in Android really that would allow you to mess it up
> > that badly AFAIK, so I doubt it's your application causing the problem
> > if your not specifically getting under the covers.
>
> > However, the meaning of the exception is clear:
>
> >http://download.oracle.com/javase/1.4.2/docs/api/java/net/UnknownHost...
> > and your app doesn't really control the process of translating a
> > domain to an ip.
>
> > - Brill Pappin
>
> > On Jan 12, 2:54 pm, Ankur Avlani  wrote:
> > > Somehow I have this feeling it is related to my app only.  Other apps on
> > the
> > > phone, I don't see any such issue.  Even when browsing on my phone, I
> > don't
> > > see any error.
>
> > > On Wed, Jan 12, 2011 at 11:41 AM, Kumar Bibek 
> > wrote:
> > > > By Wi-Fi, I meant, you phone's Wi-Fi could be turning on and off. There
> > is
> > > > no other reason I can think of. It happens for me as well, sometimes.
>
> > > > Kumar Bibek
> > > >http://techdroid.kbeanie.com
> > > >http://www.kbeanie.com
>
> > > > On Thu, Jan 13, 2011 at 1:10 AM, Ankur Avlani  > >wrote:
>
> > > >> I am sorry, that somehow doesn't convince me.  I am connected to the
> > same
> > > >> wifi on my laptop and i never see any web page load error on my
> > laptop.
>
> > > >> On Wed, Jan 12, 2011 at 11:38 AM, Kumar Bibek  > >wrote:
>
> > > >>> Yup, then it's a problem with your Wi-Fi.
>
> > > >>> Kumar Bibek
> > > >>>http://techdroid.kbeanie.com
> > > >>>http://www.kbeanie.com
>
> > > >>> On Thu, Jan 13, 2011 at 1:07 AM, Ankur Avlani  > >wrote:
>
> > >  I am connected to network, I am on Wifi.  If i try again it works.
> >  Its
> > >  just random.
>
> > >  On Wed, Jan 12, 2011 at 11:34 AM, Kumar Bibek  > >wrote:
>
> > > > This error/exception comes because of no network connectivity.
>
> > > > Kumar Bibek
> > > >http://techdroid.kbeanie.com
> > > >http://www.kbeanie.com
>
> > > > On Thu, Jan 13, 2011 at 1:02 AM, Ankur Avlani <
> > ankuravl...@gmail.com>wrote:
>
> > > >> Hi All,
>
> > > >> I am developing an application on Android.  I have seen that at
> > times
> > > >> when I try to connect using HttpURLConnection, for getting an
> > Image or
> > > >> anydata, I get the following error:
>
> > > >> 01-12 11:24:05.073: WARN/System.err(16780):
> > > >> java.net.UnknownHostException: Host is unresolved:www.XXX.com:80.
>
> > > >> Note: I get this error on my Motorolla Droid and not in emulator.
>
> > > >> Any ideas?
>
> > > >> Thanks,
> > > >> Ankur
>
> > > >>  --
> > > >> 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 > > >>  cr...@googlegroups.com> > cr...@googlegroups.com>
> > > >> For more options, visit this group at
> > > >>http://groups.google.com/group/android-developers?hl=en
>
> > > >  --
> > > > You received this message because you are subscribed to the Google
> > > > Groups "Android Developers" group.
> > > > To post to this group, send email to
> > > > android-developers@googlegroups.com
> > > > To unsubscribe from this group, send email to
> > > > android-developers+unsubscr...@googlegroups.com > > >  cr...@googlegroups.com> > cr...@googlegroups.com>
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/android-developers?hl=en
>
> > >   --
> > >  You received this message because you are subscribed to the Google
> > >  Groups "Android Developers" group.
> > >  To post to this group, send email to
> > >  android-developers@googl

[android-developers] Re: HttpURLConnection gives UnknownHostException

2011-01-12 Thread Dan
Hello All,

I have had this error both on emulator and a Motorola Droid while
using a WIFI connection.  I have surrounded the http request with WIFI
state checks and before and after WIFI is reported state 3
(WIFI_STATE_ENABLED) and I also . I have also confirmed, using an adb
shell with the emulator, that the emulator cannot ping the website in
question giving a domain resolution error. To compare notes with
Ankur, is the server on your LAN and the IP used internal? mine is.

I have also tried AndroidHttpClient which does work on the same url.

-Dan

On Jan 12, 12:23 pm, Ankur Avlani  wrote:
> True, I agree with what you say.  Its just that I feel, other apps should
> also break or give error.
>
> Anywayz, Thanks a lot for your inputs.
>
> regards,
> Ankur.
>
>
>
>
>
>
>
> On Wed, Jan 12, 2011 at 12:17 PM, Brill Pappin  wrote:
> > Well i suppose thats possible if your messing with the network stack,
> > but it's pretty low level for Java/Android.
> > I guess its also possible that the Android version you have has a
> > crappy stack or driver... or you have rooted it and have been messing
> > around under the covers so to speak.
>
> > There is nothing in Android really that would allow you to mess it up
> > that badly AFAIK, so I doubt it's your application causing the problem
> > if your not specifically getting under the covers.
>
> > However, the meaning of the exception is clear:
>
> >http://download.oracle.com/javase/1.4.2/docs/api/java/net/UnknownHost...
> > and your app doesn't really control the process of translating a
> > domain to an ip.
>
> > - Brill Pappin
>
> > On Jan 12, 2:54 pm, Ankur Avlani  wrote:
> > > Somehow I have this feeling it is related to my app only.  Other apps on
> > the
> > > phone, I don't see any such issue.  Even when browsing on my phone, I
> > don't
> > > see any error.
>
> > > On Wed, Jan 12, 2011 at 11:41 AM, Kumar Bibek 
> > wrote:
> > > > By Wi-Fi, I meant, you phone's Wi-Fi could be turning on and off. There
> > is
> > > > no other reason I can think of. It happens for me as well, sometimes.
>
> > > > Kumar Bibek
> > > >http://techdroid.kbeanie.com
> > > >http://www.kbeanie.com
>
> > > > On Thu, Jan 13, 2011 at 1:10 AM, Ankur Avlani  > >wrote:
>
> > > >> I am sorry, that somehow doesn't convince me.  I am connected to the
> > same
> > > >> wifi on my laptop and i never see any web page load error on my
> > laptop.
>
> > > >> On Wed, Jan 12, 2011 at 11:38 AM, Kumar Bibek  > >wrote:
>
> > > >>> Yup, then it's a problem with your Wi-Fi.
>
> > > >>> Kumar Bibek
> > > >>>http://techdroid.kbeanie.com
> > > >>>http://www.kbeanie.com
>
> > > >>> On Thu, Jan 13, 2011 at 1:07 AM, Ankur Avlani  > >wrote:
>
> > >  I am connected to network, I am on Wifi.  If i try again it works.
> >  Its
> > >  just random.
>
> > >  On Wed, Jan 12, 2011 at 11:34 AM, Kumar Bibek  > >wrote:
>
> > > > This error/exception comes because of no network connectivity.
>
> > > > Kumar Bibek
> > > >http://techdroid.kbeanie.com
> > > >http://www.kbeanie.com
>
> > > > On Thu, Jan 13, 2011 at 1:02 AM, Ankur Avlani <
> > ankuravl...@gmail.com>wrote:
>
> > > >> Hi All,
>
> > > >> I am developing an application on Android.  I have seen that at
> > times
> > > >> when I try to connect using HttpURLConnection, for getting an
> > Image or
> > > >> anydata, I get the following error:
>
> > > >> 01-12 11:24:05.073: WARN/System.err(16780):
> > > >> java.net.UnknownHostException: Host is unresolved:www.XXX.com:80.
>
> > > >> Note: I get this error on my Motorolla Droid and not in emulator.
>
> > > >> Any ideas?
>
> > > >> Thanks,
> > > >> Ankur
>
> > > >>  --
> > > >> 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 > > >>  cr...@googlegroups.com> > cr...@googlegroups.com>
> > > >> For more options, visit this group at
> > > >>http://groups.google.com/group/android-developers?hl=en
>
> > > >  --
> > > > You received this message because you are subscribed to the Google
> > > > Groups "Android Developers" group.
> > > > To post to this group, send email to
> > > > android-developers@googlegroups.com
> > > > To unsubscribe from this group, send email to
> > > > android-developers+unsubscr...@googlegroups.com > > >  cr...@googlegroups.com> > cr...@googlegroups.com>
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/android-developers?hl=en
>
> > >   --
> > >  You received this message because you are subscribed to the Google
> > >  Groups "Android Developers" group.
> > >  To post to this group, send email to
> > >  android-developers@googlegroups.com
> > > 

[android-developers] SQLite database is puffed every time I run my app.

2011-01-12 Thread Tobiah

I took my code from the NotePad tutorial:

private static class DatabaseHelper extends SQLiteOpenHelper {

DatabaseHelper(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION);
}

@Override
public void onCreate(SQLiteDatabase db) {

Log.e(TAG, "CREATING DAG");
createDB(db);
}

@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int 
newVersion) {
Log.e(TAG, "Upgrading database from version " + oldVersion + 
" to "
+ newVersion + ", which will destroy all old 
data");

db.execSQL("DROP TABLE IF EXISTS scan");
db.execSQL("DROP TABLE IF EXISTS notes");
db.execSQL("DROP TABLE IF EXISTS attendee");
db.execSQL("DROP TABLE IF EXISTS attendeeqanswerlink");
db.execSQL("DROP TABLE IF EXISTS lead");
db.execSQL("DROP TABLE IF EXISTS leadnotes");
db.execSQL("DROP TABLE IF EXISTS qanswer");
db.execSQL("DROP TABLE IF EXISTS qquestion");
db.execSQL("DROP TABLE IF EXISTS rolodex");
db.execSQL("DROP TABLE IF EXISTS showinfo");

onCreate(db);
}
}

I can tell from the log that onCreate() is being called every time I start up 
my app.  onUpgrade() is not
being called.  I can add data to the database using rawQuery().  While the app 
is running I can pull
the database file to my dev box and select records from the copy.  If I restart 
the app, then pull
the database, it's empty.

What could be wrong?

Thanks!

Tobiah

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] C++ exception support confusion

2011-01-12 Thread Allen Curtis
Hello,

I am in the process of porting C++ libraries to Android that use libsigc++. 
However I am confused about the support provided in the NDK.

The Stable APIs document states the following:
C++ Library:

...
They may not contain all definitions required by the standard. Notably,
support for C++ exceptions and RTTI is not available with Android 1.5 system
images.


The Standalone Toolchain document states this:
5.3 Exceptions, RTTI and STL:
- - - - - - - - - - - - - - -
The toolchain binaries *do* support C++ exceptions and RTTI by default.


Can someone clarify?

TIA

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Can't find Activity error

2011-01-12 Thread John Lussmyer
I'm trying to use an Intent() to send a little data to another app.
So far, I've been unable to get the startActivity() to succeed.  It always
fails with a ActivityNotFound exception.
I just haven't been able to figure out WHY my activity isn't being found.

invoking code is:

Intent intent = new
Intent("com.casadelgato.lifewallpaper.UPDATEPREFS");
intent.setPackage("com.casadelgato.lifewallpaper");
intent.putExtra("PrefUpdate", true);
startActivity(intent);


Manifest of target app is:


http://schemas.android.com/apk/res/android";
package="com.casadelgato.lifewallpaper"
android:versionName="1.0.3"
android:versionCode="4"
android:sharedUserId="@string/SharedUserID">





















-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: image background - how to repeat an image rather than strech it

2011-01-12 Thread Doug
See BitmapDrawable and its related xml configuration documentation if
you want to tile an image for the background of a View.

On Jan 12, 12:57 am, liordav  wrote:
> Hi,
> I have an image I want to use as a background to some layout.
> the problem is the image contains a texture of slant lines, so if i
> use a 1 pixel width image or a 9 patch the image is stretched and the
> texture is Twitching, so i can see the slant lines as latitude lines.
> I saw that he android emulator uses a similar texture in the progress
> bar indeterminate animation, is there a special/simple definition to
> order the background image to repeat itself rather than stretch? is
> there a way to do it with 9 patch, cause eventualy i also need the
> corners to be round.
> thanks for the help.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] I ask for power off but get reboot instead sometimes

2011-01-12 Thread TreKing
On Wed, Jan 12, 2011 at 4:01 PM, higonnet  wrote:

> I find this disconcerting at best, since the reason I'm powering the thing
> off is that it isn't behaving the way it usually does...
>

http://www.htc.com/www/support/nexusone/

I'm sending in my second replacement tonight. Nice phone but sure is
brittle.

-
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

Re: [android-developers] app showing as unpublished

2011-01-12 Thread TreKing
2011/1/12 Éva Lovrencsics 

> I have 7 apps. All of them are set to unpublished today. I don't know what
> happened.
> Does somebody know?
>

Issues with the Android Market should go to the Android Market "Support"
forum. There you will find posts like this:
http://www.google.co.uk/support/forum/p/Android+Market/thread?tid=145eb3ce9a9f766a&hl=en

-
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

Re: [android-developers] I ask for power off but get reboot instead sometimes

2011-01-12 Thread Bernard T. Higonnet

TreKing wrote:
On Wed, Jan 12, 2011 at 4:01 PM, higonnet > wrote:


Subject line basically says it all.


No it doesn't. Like what "ask for power off" means.


Press and hold power button, then press "Power off" in menu selection of 
"Phone options" pop-up menu.


Hope that's clear.

Bernard Higonnet

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Google Voice SMS "sms_body" not working

2011-01-12 Thread TreKing
On Wed, Jan 12, 2011 at 4:26 PM, Jas  wrote:

> Am I missing something here? Does GV need a special handing that it can’t
> be treated as same as default “Messaging” app?
>

I don't know, but the fact that you're hardcoding the key is a flag.
See if this helps:
http://developer.android.com/reference/android/content/Intent.html#EXTRA_TEXT

-
TreKing  - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] app showing as unpublished

2011-01-12 Thread Éva Lovrencsics
Hello,

I have 7 apps. All of them are set to unpublished today. I don't know
what happened.
Does somebody know?

Evi

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] AccountManager undocumented exception returns "unknown authTokenType"

2011-01-12 Thread H
Hi,

I'm calling the AccountManager like this:

accountManagerFutureOld = mAccountManager.getAuthToken(mAccount, "cl", 
false, null, null);

The Account being passed in is a Google account (type="com.google").

This works perfectly well for thousands of users of my app. But a handful of 
times each day, some users are getting this error

java.lang.IllegalArgumentException: unknown authTokenType
at 
android.accounts.AccountManager.convertErrorToException(AccountManager.java:1093)
at android.accounts.AccountManager.access$500(AccountManager.java:74)
at 
android.accounts.AccountManager$AmsTask$Response.onError(AccountManager.java:944)
at 
android.accounts.IAccountManagerResponse$Stub.onTransact(IAccountManagerResponse.java:69)
at android.os.Binder.execTransact(Binder.java:287)
at dalvik.system.NativeStart.run(Native Method)

This isn't an exception that the javadoc says comes from this method!

I think this is coming from the 
AbstractAccountAuthenticator.getAuthTokenLabel(IAccountAuthenticatorResponse, 
String) who in turn catches this exception from the concrete 
authenticator's getAuthTokenLabel(String) method. I've decompiled the gsf 
and looked in this method, but can't see any throw of 
an IllegalArgumentException in there. All it really does is call the 
PackageManager.getPermissionInfo() and retrieve attributes of the 
PermissionInfo returned.

Looking at the details for the reports, I *think* these reports are only 
coming from non google devices - for example the reported models include 
MID-7AS, XT800, EFREN II, etc. I don't see any mentions of nice devices like 
Desire or Nexus, etc.

At first I thought this was just people forcing my app onto a non gapps 
device, but the fact that they have a Google account on the device which can 
be happily enumerated and retrieved using the standard api (i.e. 
type-com.google) makes me think they at least have the full google services 
framework otherwise they wouldn't have the GoogleLoginService.

So does anyone know exactly what this error thinks is missing..? Is there 
any way to spot this before trying the call?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] I ask for power off but get reboot instead sometimes

2011-01-12 Thread TreKing
On Wed, Jan 12, 2011 at 4:01 PM, higonnet  wrote:

> Subject line basically says it all.


No it doesn't. Like what "ask for power off" means.

-
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

Re: [android-developers] ListView seems to consume screen from its location downward.

2011-01-12 Thread TreKing
On Wed, Jan 12, 2011 at 2:48 PM, Tobiah  wrote:

> Am I doing something wrong?


Well, you're setting up a layout programmatically, for starters.

If you insist on doing it this way, make sure you also explicitly set
LayoutParams where appropriate. Maybe also set layout weight on the
ListView.

-
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

Re: [android-developers] Contacts does not work with different Android versions !!

2011-01-12 Thread TreKing
On Wed, Jan 12, 2011 at 2:22 PM, 20plus10 <20plu...@gmail.com> wrote:

> Contacts does not work with different Android versions !!
>
Is there any reason for this problem?
>

If you mean the "Contacts" class, the reason for this "problem" is it was
deprecated.


> any workaround?
>

Try reading the documentation.

-
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

Re: [android-developers] Re: Particularity running modified standard app

2011-01-12 Thread Kostya Vasilyev
Check the manifest for your custom version, to see if there is an activity
with an intent filter that is launched by a specific action name (as opposed
by class). I'd think there might be. If so, change the action string to be
different from the standard application in the manifest and in your code.
Check broadcast receivers as well.

Oh, and there is no such thing as "clone of another application" to Android.
If you use the same action strings, or package names as another app, you're
asking for trouble.

--
Kostya Vasilyev -- http://kmansoft.wordpress.com
13.01.2011 1:26 пользователь "Bernard T. Higonnet" 
написал:
> Kostya Vasilyev wrote:
>> 12.01.2011 23:49, higonnet пишет:
>>> I did not change the package name.
>>>
>> Do that then.
>
> Well, it gets curioser and curioser.
>
> Please fasten seatbelts for what follows.
>
> Before describing what happened when I did change the package name, I
> have to say that without knowledge of how Android keeps different
> applications/tasks apart to protect the operating system and other
> tasks, I think the present scheme defective.
>
> It seems to me that the standard expected behavior is that two distinct
> applications, even if one is a clone of the other, should operate
> completely independently (unless of course they are sharing peripheral
> hardware), and no matter what one does in one application (no matter how
> stupid) should cause anything to happen in the other. Just for the
> record, in all that follows, at no time are the two camera applications
> (factory and mine) running at the same time.
>
> So. I uninstall the previous version of my app. I change all the
> "com.android.camera" to "x.y.z" everywhere with refactor and global
> search/replace. Eclipse is happy, says there are 14 warnings, which is
> what I got with the original camera app.
>
> I now run my app from Eclipse and result is the same! (to recap: running
> from Eclipse I see my mods; running from my mods installed on phone by
> Eclipse I get standard camera app.).
>
> So at this point, I impishly wonder what will happen if I power off (I
> get a reboot instead, but why argue...?)? I run my mods from app
> launcher. Hooray! I get my mods. I kill my mods with Taskiller. I now
> run standard camera app. I get my mods instead!!!
>
> I am in a bit of a bad mood now, and ask what I have wondered silently
> for months just using the phone as a user, viz. is this thing ready for
> prime time?
>
> Bernard Higonnet
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Sharing preferences between apps?

2011-01-12 Thread Dianne Hackborn
Each app is in its own sandbox.  You should use one of the standard
components for interacting between them -- activity, service, receiver,
provider.

On Wed, Jan 12, 2011 at 10:46 AM, John Lussmyer wrote:

> I have an app that needs to be able to pass a set of settings to my Live
> Wallpaper.
> The Live Wallpaper already saves these in a Shared Preferences file.
> I did a bunch of searches, and found a possible way for the app to access
> the wallpapers Shared prefs was:
> (I've also set both apps to have the same uid in their manifest files.)
>
> Context context =
> this.createPackageContext("com.casadelgato.lifewallpaper", 0);
> SharedPreferences wPrefs =
> context.getSharedPreferences(Constants.LW_SHARED_PREFS, 0);
> Editor editor = wPrefs.edit();
> editor.putBoolean(Constants.PREF_RANDCOLORS,
> engine.isRandColors());
> etc...
>
> When I try, I get:
>
> 01-12 10:37:20.728: WARN/ApplicationContext(293): Attempt to read
> preferences file
> /data/data/com.casadelgato.lifewallpaper/shared_prefs/lifewallpapersettings.xml
> without permission
> 01-12 10:37:20.757: ERROR/ApplicationContext(293): Couldn't rename file
> /data/data/com.casadelgato.lifewallpaper/shared_prefs/lifewallpapersettings.xml
> to backup file
> /data/data/com.casadelgato.lifewallpaper/shared_prefs/lifewallpapersettings.xml.bak
>
> Am I missing something?  Or is this just the wrong way to do it.
>
>  --
> 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




-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Confusing IllegalArgumentException from openFileOutput

2011-01-12 Thread John Lussmyer
Figured it out.
Apparently, even though you are allowed to getFilesDir(), you aren't allowed
to actually specify that directory in a path.
The file name you pass to openFileOutput() must be a relative path to that
directory, and may not specify that directory.
Intuitively obvious that isn't.

On Wed, Jan 12, 2011 at 2:04 PM, John Lussmyer wrote:

> I'm trying to create a new file in my data area, and I'm getting this
> exception:
>
> 01-12 13:59:41.202: ERROR/AndroidRuntime(1437):
> java.lang.IllegalArgumentException: File
> /data/data/com.casadelgato.lifewallpaper/files/LifeSettings.ini contains a
> path separator
>
> As far as I can tell, that's a valid file spec.
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Comparing values afterTextChanged

2011-01-12 Thread H
No worries.

I should probably clarify a bit by saying that you should only really use 
the "==" when comparing primitives. For non primitives (e.g. any Object 
class - basically anything that starts with a capital letter), most of the 
time, you are probably wanting to use .equals.

Remember that the .equals class can be overriden on any class so some 
classes can customise and choose exactly how to test for equality. If you 
use the "==" then you have no choice in how that test is run other than the 
default way which compares the memory references.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: SensorManager failing to start listener thread

2011-01-12 Thread db
Hi,

I found the problem: there was an error in my sensor library that caused an 
invalid file descriptor to be returned from control__open_data_source().

So if anyone else runs into a problem like this, definitely check that your 
sensor library is returning a valid file descriptor. :)
--
Regards, Devin

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] (Unknown) contact showing up after a modify

2011-01-12 Thread Simon MacDonald
Hi all,

I have a weird issue on an Android 2.2 device.  I have an existing
contact and I do a modify operation on it via:

ContentProviderOperation.Builder builder =
ContentProviderOperation.newUpdate(ContactsContract.Data.CONTENT_URI)
.withSelection(ContactsContract.Data.CONTACT_ID + "=? AND " +
ContactsContract.Data.MIMETYPE + "=?",
new String[]{id,
ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE})
.withValue(ContactsContract.CommonDataKinds.StructuredName.DISPLAY_NAME,
displayName)
.withValue(ContactsContract.CommonDataKinds.StructuredName.FAMILY_NAME,
familyName)
.withValue(ContactsContract.CommonDataKinds.StructuredName.MIDDLE_NAME,
middleName)
.withValue(ContactsContract.CommonDataKinds.StructuredName.GIVEN_NAME,
givenName)
.withValue(ContactsContract.CommonDataKinds.StructuredName.PREFIX,
honorificPrefix)
.withValue(ContactsContract.CommonDataKinds.StructuredName.SUFFIX,
honorificSuffix);

mApp.getContentResolver().applyBatch(ContactsContract.AUTHORITY, ops);

The contact gets modified correctly.  All of the new values show up
for the Contacts name.

However, if I look in my Contacts app there is a new contact called
"(Unknown)" that shows up after I do a modify.  I can insert as many
contacts as I want but every modify creates a new "(Unknown)" contact.

Anyone have any ideas?

Simon Mac Donald
http://hi.im/simonmacdonald

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] WebView pauseTimers()

2011-01-12 Thread Dan
Hello All,

I am working on a an application that it trying to use the
WebView.pauseTimers() API. I am still getting console messages from my
JavaScript setInterval method after calling pauseTimers(). I was
wondering if this is a known problem, could I be missing a step, or an
alternative API that will suspend the setInterval timer.

Thank you,
-Dan

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Google Voice SMS "sms_body" not working

2011-01-12 Thread Jas
I use the following code to start the SMS application:

Intent smsIntent=new Intent(Intent.ACTION_SENDTO,
Uri.parse("smsto:"));
smsIntent.putExtra("sms_body", "Message Body");
startActivity(smsIntent);

 It works fine if user selects default "Messaging" application. But if
user selects GV the message body text is not populated.

I have searched all the forums I know off and tried lot of things.
Nothing worked for me. I don't have any filters or permission in
Manifest file specific for SMS.  Am I missing something here? Does GV
need a special handing that it can’t be treated as same as default
“Messaging” app?

If I can't fix it, I would prefer to remove the GV from choices
offered to users. How can I start the default messaging app with body
text filled in, without offering any choices to user?

Please help or provider any direction for debug.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: Particularity running modified standard app

2011-01-12 Thread Bernard T. Higonnet

Kostya Vasilyev wrote:

12.01.2011 23:49, higonnet пишет:

I did not change the package name.


Do that then.


Well, it gets curioser and curioser.

Please fasten seatbelts for what follows.

Before describing what happened when I did change the package name, I 
have to say that without knowledge of how Android keeps different 
applications/tasks apart to protect the operating system and other 
tasks, I think the present scheme defective.


It seems to me that the standard expected behavior is that two distinct 
applications, even if one is a clone of the other, should operate 
completely independently (unless of course they are sharing peripheral 
hardware), and no matter what one does in one application (no matter how 
stupid) should cause anything to happen in the other. Just for the 
record, in all that follows, at no time are the two camera applications 
(factory and mine) running at the same time.


So. I uninstall the previous version of my app. I change all the 
"com.android.camera" to "x.y.z" everywhere with refactor and global 
search/replace. Eclipse is happy, says there are 14 warnings, which is 
what I got with the original camera app.


I now run my app from Eclipse and result is the same! (to recap: running 
from Eclipse I see my mods; running from my mods installed on phone by 
Eclipse I get standard camera app.).


So at this point, I impishly wonder what will happen if I power off (I 
get a reboot instead, but why argue...?)? I run my mods from app 
launcher. Hooray! I get my mods. I kill my mods with Taskiller. I now 
run standard camera app. I get my mods instead!!!


I am in a bit of a bad mood now, and ask what I have wondered silently 
for months just using the phone as a user, viz. is this thing ready for 
prime time?


Bernard Higonnet


--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Particularity running modified standard app

2011-01-12 Thread Bernard T. Higonnet

TreKing wrote:
On Wed, Jan 12, 2011 at 2:35 PM, Bernard T. Higonnet 
mailto:bthigon...@gmail.com>> wrote:


But when I run X from the app launcher, I get Camera!


What does "I get Camera!" mean?


It means I get the standard factory camera application, and not my 
modified version which I have called "X".


Bernard Higonnet

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Particularity running modified standard app

2011-01-12 Thread TreKing
On Wed, Jan 12, 2011 at 2:35 PM, Bernard T. Higonnet
wrote:

> But when I run X from the app launcher, I get Camera!
>

What does "I get Camera!" mean?

-
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

Re: [android-developers] Re: Soft keyboard alters layout

2011-01-12 Thread Kostya Vasilyev

Neil,

The link provided by TreKing says that:

With the standard IMEs, you will only encounter this situation when 
the screen is in a landscape orientation, although other IMEs are free 
to use it whenever they desire. In this case the application window is 
left as-is, and the IME simply displays fullscreen on top of it.


So looks like there is no universal way to get this mode.

You could try setting this on your activity in the manifest:

android:windowSoftInputMode="stateVisible|adjustPan"

This will move the entire layout of your activity up if needed, but only 
as far as necessary to show the control being edited.


Your edit control should be above the navigation bar, so the bar is 
covered by the keyboard itself.


-- Kostya

13.01.2011 0:47, Neilz пишет:

Thanks...but to be honest it doesn't help one bit!

It shows a diagram of exactly what I want, but doesn't actually say
how you achieve it. I've tried a few of the code snippets but nothing
made any difference.

It mentions 'full screen' or 'extract mode' - which I think may be
what I'm after - but I can't see how I set that.

On Jan 12, 5:42 pm, TreKing  wrote:

On Wed, Jan 12, 2011 at 3:18 AM, Neilz  wrote:

Is there a way I can stop this? Surely the keyboard can act as a frame and
overlay the existing views?

See if this 
helps:http://developer.android.com/resources/articles/on-screen-inputs.html

-
TreKing  - Chicago
transit tracking app for Android-powered devices



--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Confusing IllegalArgumentException from openFileOutput

2011-01-12 Thread John Lussmyer
I'm trying to create a new file in my data area, and I'm getting this
exception:

01-12 13:59:41.202: ERROR/AndroidRuntime(1437):
java.lang.IllegalArgumentException: File
/data/data/com.casadelgato.lifewallpaper/files/LifeSettings.ini contains a
path separator

As far as I can tell, that's a valid file spec.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] I ask for power off but get reboot instead sometimes

2011-01-12 Thread higonnet
Subject line basically says it all.

As a completely wild guess, I'd say this happens 10% to 15% of the
time, on my unrooted, normal Nexus One.

I find this disconcerting at best, since the reason I'm powering the
thing off is that it isn't behaving the way it usually
does...

Not at all sure of following, but seems to happen more with 2.2 than
before?

Bernard Higonnet

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Comparing values afterTextChanged

2011-01-12 Thread H
You can't test for equality on a String using "==" as that will just check 
to see if the object memory reference is the same. You need to use .equals 
i.e myTotal.equals(myInput)

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Soft keyboard alters layout

2011-01-12 Thread Neilz
Thanks...but to be honest it doesn't help one bit!

It shows a diagram of exactly what I want, but doesn't actually say
how you achieve it. I've tried a few of the code snippets but nothing
made any difference.

It mentions 'full screen' or 'extract mode' - which I think may be
what I'm after - but I can't see how I set that.

On Jan 12, 5:42 pm, TreKing  wrote:
> On Wed, Jan 12, 2011 at 3:18 AM, Neilz  wrote:
> > Is there a way I can stop this? Surely the keyboard can act as a frame and
> > overlay the existing views?
>
> See if this 
> helps:http://developer.android.com/resources/articles/on-screen-inputs.html
>
> -
> 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


Re: [android-developers] Re: Particularity running modified standard app

2011-01-12 Thread Kostya Vasilyev

12.01.2011 23:49, higonnet пишет:

I did not change the package name.


Do that then.

You can't publish applications that use "com.android.*" or "android.*" 
for package name anyway.


--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Particularity running modified standard app

2011-01-12 Thread higonnet
I should clarify that I changed

android:label in .

I did not change the package name.

Bernard Higonnet

On Jan 12, 8:41 pm, higonnet  wrote:
> On Jan 12, 5:53 pm, Kostya Vasilyev  wrote:
>
> > Did you change the package name in the code and in the manifest?
>
> I did. It shows up with the name X in the app launcher and also in the
> list of running tasks (when using Taskiller for example).
>
> Bernard Higonnet
>
>
>
> > 12.01.2011 20:52, higonnet пишет:
>
> > > Hello,
>
> > > I have downloaded and slightly modified the Android 2.2 version of
> > > Camera and have begun to make some changes to it.
>
> > > Let's say I have renamed the app to "X" in Eclipse
>
> > > If I run X from Eclipse (Helios), it behaves more or less the way I
> > > expect. Running from Eclipse installs X on my device (Nexus One). But
> > > when I run X from the app launcher, I get Camera!
>
> > > I would be thankful to
>
> > > 1) know why
> > > 2) general info on modifying a standard app
>
> > > TIA
> > > Bernard Higonnet
>
> > --
> > Kostya Vasilyev -- WiFi Manager + pretty widget 
> > --http://kmansoft.wordpress.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] ListView seems to consume screen from its location downward.

2011-01-12 Thread Tobiah

I'm making my screen up programmatically:

LinearLayout l = new LinearLayout(this);
l.setOrientation(LinearLayout.VERTICAL);

l.addView(getBarcodeButton());

result = new TextView(this);
result.setText(borg.phone_number);
l.addView(result);

ListView lv = new ListView(this);
String[] a = {"cat", "dog", "foo", "bar", "cat", "dog", "foo", "bar", "cat", "dog", 
"foo", "bar"};
lv.setAdapter(new ArrayAdapter(this, 
android.R.layout.simple_list_item_1, a));
l.addView(lv);

setContentView(l);


This works fine so long as the ListView is the last item in the LinearLayout.
If I move the button or the text below the ListView, the become invisible; the
ListView always extends to the bottom of the screen.

Am I doing something wrong?

Thanks,

Tobiah

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Particularity running modified standard app

2011-01-12 Thread higonnet


On Jan 12, 5:53 pm, Kostya Vasilyev  wrote:
> Did you change the package name in the code and in the manifest?

I did. It shows up with the name X in the app launcher and also in the
list of running tasks (when using Taskiller for example).

Bernard Higonnet


>
> 12.01.2011 20:52, higonnet пишет:
>
>
>
> > Hello,
>
> > I have downloaded and slightly modified the Android 2.2 version of
> > Camera and have begun to make some changes to it.
>
> > Let's say I have renamed the app to "X" in Eclipse
>
> > If I run X from Eclipse (Helios), it behaves more or less the way I
> > expect. Running from Eclipse installs X on my device (Nexus One). But
> > when I run X from the app launcher, I get Camera!
>
> > I would be thankful to
>
> > 1) know why
> > 2) general info on modifying a standard app
>
> > TIA
> > Bernard Higonnet
>
> --
> Kostya Vasilyev -- WiFi Manager + pretty widget 
> --http://kmansoft.wordpress.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Bluetooth API & Device Power Modes

2011-01-12 Thread goosedroid
The current Bluetooth API documentation does not seem to mention the
behavior of the Bluetooth radio and API when the device goes to sleep.

What should happen in these scenarios?

#1 If the device goes to sleep while connected to a BT device, does
the Bluetooth radio stay on (are connections and streams preserved?)

#2 If no to #1, can a partial wakelock prevent the Bluetooth subsystem
from becoming deactivated?

#3 If yes to #1, will I get a broadcast if the other device drops a
connection and I have registered a BroadcastReceiver listening for
ACL_DISCONNECT?

#4 If the device is asleep, can incoming Bluetooth data on an
established BT connection data wake up the device?

There are probably more such cases I have not considered. Any help
would be welcome.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Android Twitter client to share Images

2011-01-12 Thread TreKing
On Wed, Jan 12, 2011 at 7:52 AM, Kumar Bibek  wrote:

> You will have to write the code yourself if you don't find any working
> samples. Sorry


Yes. Also, questions regarding Twitter (or Facebook, or whatever) are best
asked on groups or forums dedicated to those APIs. This is a group for the
Android SDK - that excludes all external add-on libraries, even if they're
built for use on Android.

-
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

Re: [android-developers] about content provider physical store location

2011-01-12 Thread Dianne Hackborn
Applications can't directly access it.

On Wed, Jan 12, 2011 at 3:26 AM, stanly  wrote:

> hi all,
>
> I have a question about content provider,
> for example,
> I used the *Telephony.Carriers.CURRENT* this URI to store all APN nodes,
> maybe it will has 100 nodes(records) in it.
> but when I insert the 100 rows data via *ContentResolver.insert*
> pragramatically,
> instead of inserting records in every product by code, I wish my every
> product can have these 100 rows data atomatically,
> so I think there must exist a *real physical store location* to store the
> *Telephony.Carriers.CURRENT* URI all records, like xxx.db.
> so that I can just copy the xxx.db to every products, and used these
> records.
>
> is there have a physical location to store records in URI?
>
> please give me some suggestion.
>
> thanks a lot!!
>
> --
> 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




-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: What is the name of this widget?

2011-01-12 Thread Dianne Hackborn
On Wed, Jan 12, 2011 at 4:42 AM, DanH  wrote:

> > No.  You can only modify it so far as it doesn't break existing
> > applications.  That can be very limiting.
> But you can replace the entire thing with "NumberChooser" when you
> need to make a "clean break".
>

Sure and then we end up with crud in the API we can't get rid of.  This is a
pretty trivial widget, and everyone has the source code to it; we aren't
going to junk up the API for this thing.

-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: How to get screen density in pixels-per-inch or equivalent

2011-01-12 Thread Dianne Hackborn
The density and densityDpi is an abstract density bucket the device
manufacturer has decided makes sense for their UI to run in.  This is what
is used to evaluate things like "dp" units and select and scale bitmaps from
resources.

The xdpi and ydpi are supposed to be the real DPI of the screen...  though
as you've seen, many devices don't set it correctly. :(  This is our fault,
it isn't actually used anywhere in the platform, so people don't realize
they have a bad value, and we haven't had a CTS test to try to make sure it
is sane (it's not clear how that test should work).  Worse, we shipping the
original Droid with a graphics driver that reports the wrong value here...
 in fact that reported that same damnable 96.

Unfortunately, I don't have a good solution if you want to get the real
exactly screen dots per inch.  One thing you could do is compare xdpi/ydpi
with densityDpi and if they are significantly far apart, assume the values
are bad and just fall back on densityDpi as an approximation.  Be careful on
this, because a correctly working device may have densityDpi fairly
different than the real dpi -- for example the Samsung TAB uses high density
even though its screen's really density is a fair amount lower than 240.

On Wed, Jan 12, 2011 at 11:31 AM, Phil Endecott <
spam_from_goo...@chezphil.org> wrote:

> Hi Richard,
>
> On Jan 12, 6:54 pm, Richard Schilling 
> wrote:
> > Did you try fetching the scale that will allow you to convert from DPI
> > to actual screen pixels?  I found this very reliable:
> >
> >  final scale =
> > getContext().getResources().getDisplayMetrics().density;
>
> The description of that says:
>
>"on a 160dpi screen this density value will be 1; on a 120 dpi
> screen
>it would be .75; etc."
>
> > Then multiply scale by one inch of pixels in DPI resolution (depending
> > on the screen you're on) - 120, 160, 240, 320.
> >
> > This API call ...
> >
> >  int densityDpi =
> > getContext().getResources().getDisplayMetrics().densityDpi;
> >
> > will tell you the density of the screen you're on.
>
> Approximately.
>
> > So, this will tell you how many screen pixels equate to an inch.
>
> I'm not at all sure that it does.
>
> >  Then
> > you can use that to lay out your ruler markings:
> >  int pxPerInch = 340; // default value - note it's a new density
> > in API version 9.
> >
> >  switch(densityDpi){
> >   case DisplayMetrics.DENSITY_LOW:
> >   pxPerInch = 120 * scale;
> >   break;
> >   case DisplayMetrics.DENSITY_MEDIUM:
> >   pxPerInch = 160 * scale;
> >   break;
> >   case DisplayMetrics.DENSITY_HIGH:
> >   pxPerInch = 240 * scale;
> >   break;
> >  }
>
> Note that the values of those constants DENSITY_* are their numeric
> values, so there is no need for the case statement; you can just
> write:
>
> pxPerInch = densityDpi * scale;
>
> However, I really don't think that does what you believe it does.  I
> think that densityDpi reliably gives the approximate dpi, and density
> just gives densityDpi/160.  Multiplying them together doesn't do
> anything useful.  But I could be wrong!
>
> Thanks,  Phil.
>
> --
> 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
>



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: HttpURLConnection gives UnknownHostException

2011-01-12 Thread Ankur Avlani
True, I agree with what you say.  Its just that I feel, other apps should
also break or give error.

Anywayz, Thanks a lot for your inputs.

regards,
Ankur.

On Wed, Jan 12, 2011 at 12:17 PM, Brill Pappin  wrote:

> Well i suppose thats possible if your messing with the network stack,
> but it's pretty low level for Java/Android.
> I guess its also possible that the Android version you have has a
> crappy stack or driver... or you have rooted it and have been messing
> around under the covers so to speak.
>
> There is nothing in Android really that would allow you to mess it up
> that badly AFAIK, so I doubt it's your application causing the problem
> if your not specifically getting under the covers.
>
> However, the meaning of the exception is clear:
>
> http://download.oracle.com/javase/1.4.2/docs/api/java/net/UnknownHostException.html
> and your app doesn't really control the process of translating a
> domain to an ip.
>
> - Brill Pappin
>
> On Jan 12, 2:54 pm, Ankur Avlani  wrote:
> > Somehow I have this feeling it is related to my app only.  Other apps on
> the
> > phone, I don't see any such issue.  Even when browsing on my phone, I
> don't
> > see any error.
> >
> >
> >
> >
> >
> >
> >
> > On Wed, Jan 12, 2011 at 11:41 AM, Kumar Bibek 
> wrote:
> > > By Wi-Fi, I meant, you phone's Wi-Fi could be turning on and off. There
> is
> > > no other reason I can think of. It happens for me as well, sometimes.
> >
> > > Kumar Bibek
> > >http://techdroid.kbeanie.com
> > >http://www.kbeanie.com
> >
> > > On Thu, Jan 13, 2011 at 1:10 AM, Ankur Avlani  >wrote:
> >
> > >> I am sorry, that somehow doesn't convince me.  I am connected to the
> same
> > >> wifi on my laptop and i never see any web page load error on my
> laptop.
> >
> > >> On Wed, Jan 12, 2011 at 11:38 AM, Kumar Bibek  >wrote:
> >
> > >>> Yup, then it's a problem with your Wi-Fi.
> >
> > >>> Kumar Bibek
> > >>>http://techdroid.kbeanie.com
> > >>>http://www.kbeanie.com
> >
> > >>> On Thu, Jan 13, 2011 at 1:07 AM, Ankur Avlani  >wrote:
> >
> >  I am connected to network, I am on Wifi.  If i try again it works.
>  Its
> >  just random.
> >
> >  On Wed, Jan 12, 2011 at 11:34 AM, Kumar Bibek  >wrote:
> >
> > > This error/exception comes because of no network connectivity.
> >
> > > Kumar Bibek
> > >http://techdroid.kbeanie.com
> > >http://www.kbeanie.com
> >
> > > On Thu, Jan 13, 2011 at 1:02 AM, Ankur Avlani <
> ankuravl...@gmail.com>wrote:
> >
> > >> Hi All,
> >
> > >> I am developing an application on Android.  I have seen that at
> times
> > >> when I try to connect using HttpURLConnection, for getting an
> Image or
> > >> anydata, I get the following error:
> >
> > >> 01-12 11:24:05.073: WARN/System.err(16780):
> > >> java.net.UnknownHostException: Host is unresolved:www.XXX.com:80.
> >
> > >> Note: I get this error on my Motorolla Droid and not in emulator.
> >
> > >> Any ideas?
> >
> > >> Thanks,
> > >> Ankur
> >
> > >>  --
> > >> 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 cr...@googlegroups.com>
> > >> For more options, visit this group at
> > >>http://groups.google.com/group/android-developers?hl=en
> >
> > >  --
> > > You received this message because you are subscribed to the Google
> > > Groups "Android Developers" group.
> > > To post to this group, send email to
> > > android-developers@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > android-developers+unsubscr...@googlegroups.com cr...@googlegroups.com>
> > > For more options, visit this group at
> > >http://groups.google.com/group/android-developers?hl=en
> >
> >   --
> >  You received this message because you are subscribed to the Google
> >  Groups "Android Developers" group.
> >  To post to this group, send email to
> >  android-developers@googlegroups.com
> >  To unsubscribe from this group, send email to
> >  android-developers+unsubscr...@googlegroups.com cr...@googlegroups.com>
> >  For more options, visit this group at
> > http://groups.google.com/group/android-developers?hl=en
> >
> > >>>  --
> > >>> You received this message because you are subscribed to the Google
> > >>> Groups "Android Developers" group.
> > >>> To post to this group, send email to
> android-developers@googlegroups.com
> > >>> To unsubscribe from this group, send email to
> > >>> android-developers+unsubscr...@googlegroups.com cr...@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
> > >

[android-developers] Contacts does not work with different Android versions !!

2011-01-12 Thread 20plus10
Hey

Contacts does not work with different Android versions !!
Is there any reason for this problem? any workaround?

Help please :-)

BR
Maali

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Particularity running modified standard app

2011-01-12 Thread Brill Pappin
update the manifest package name, and double check the resources for
the string.

You simply missed something.

- Brill

On Jan 12, 12:52 pm, higonnet  wrote:
> Hello,
>
> I have downloaded and slightly modified the Android 2.2 version of
> Camera and have begun to make some changes to it.
>
> Let's say I have renamed the app to "X" in Eclipse
>
> If I run X from Eclipse (Helios), it behaves more or less the way I
> expect. Running from Eclipse installs X on my device (Nexus One). But
> when I run X from the app launcher, I get Camera!
>
> I would be thankful to
>
> 1) know why
> 2) general info on modifying a standard app
>
> TIA
> Bernard Higonnet

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: HttpURLConnection gives UnknownHostException

2011-01-12 Thread Brill Pappin
Well i suppose thats possible if your messing with the network stack,
but it's pretty low level for Java/Android.
I guess its also possible that the Android version you have has a
crappy stack or driver... or you have rooted it and have been messing
around under the covers so to speak.

There is nothing in Android really that would allow you to mess it up
that badly AFAIK, so I doubt it's your application causing the problem
if your not specifically getting under the covers.

However, the meaning of the exception is clear:
http://download.oracle.com/javase/1.4.2/docs/api/java/net/UnknownHostException.html
and your app doesn't really control the process of translating a
domain to an ip.

- Brill Pappin

On Jan 12, 2:54 pm, Ankur Avlani  wrote:
> Somehow I have this feeling it is related to my app only.  Other apps on the
> phone, I don't see any such issue.  Even when browsing on my phone, I don't
> see any error.
>
>
>
>
>
>
>
> On Wed, Jan 12, 2011 at 11:41 AM, Kumar Bibek  wrote:
> > By Wi-Fi, I meant, you phone's Wi-Fi could be turning on and off. There is
> > no other reason I can think of. It happens for me as well, sometimes.
>
> > Kumar Bibek
> >http://techdroid.kbeanie.com
> >http://www.kbeanie.com
>
> > On Thu, Jan 13, 2011 at 1:10 AM, Ankur Avlani wrote:
>
> >> I am sorry, that somehow doesn't convince me.  I am connected to the same
> >> wifi on my laptop and i never see any web page load error on my laptop.
>
> >> On Wed, Jan 12, 2011 at 11:38 AM, Kumar Bibek wrote:
>
> >>> Yup, then it's a problem with your Wi-Fi.
>
> >>> Kumar Bibek
> >>>http://techdroid.kbeanie.com
> >>>http://www.kbeanie.com
>
> >>> On Thu, Jan 13, 2011 at 1:07 AM, Ankur Avlani 
> >>> wrote:
>
>  I am connected to network, I am on Wifi.  If i try again it works.  Its
>  just random.
>
>  On Wed, Jan 12, 2011 at 11:34 AM, Kumar Bibek 
>  wrote:
>
> > This error/exception comes because of no network connectivity.
>
> > Kumar Bibek
> >http://techdroid.kbeanie.com
> >http://www.kbeanie.com
>
> > On Thu, Jan 13, 2011 at 1:02 AM, Ankur Avlani 
> > wrote:
>
> >> Hi All,
>
> >> I am developing an application on Android.  I have seen that at times
> >> when I try to connect using HttpURLConnection, for getting an Image or
> >> anydata, I get the following error:
>
> >> 01-12 11:24:05.073: WARN/System.err(16780):
> >> java.net.UnknownHostException: Host is unresolved:www.XXX.com:80.
>
> >> Note: I get this error on my Motorolla Droid and not in emulator.
>
> >> Any ideas?
>
> >> Thanks,
> >> Ankur
>
> >>  --
> >> 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 >>  cr...@googlegroups.com>
> >> For more options, visit this group at
> >>http://groups.google.com/group/android-developers?hl=en
>
> >  --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to
> > android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com >  cr...@googlegroups.com>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
>   --
>  You received this message because you are subscribed to the Google
>  Groups "Android Developers" group.
>  To post to this group, send email to
>  android-developers@googlegroups.com
>  To unsubscribe from this group, send email to
>  android-developers+unsubscr...@googlegroups.com   cr...@googlegroups.com>
>  For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>
> >>>  --
> >>> You received this message because you are subscribed to the Google
> >>> Groups "Android Developers" group.
> >>> To post to this group, send email to android-developers@googlegroups.com
> >>> To unsubscribe from this group, send email to
> >>> android-developers+unsubscr...@googlegroups.com >>>  cr...@googlegroups.com>
> >>> For more options, visit this group at
> >>>http://groups.google.com/group/android-developers?hl=en
>
> >>  --
> >> You received this message because you are subscribed to the Google
> >> Groups "Android Developers" group.
> >> To post to this group, send email to android-developers@googlegroups.com
> >> To unsubscribe from this group, send email to
> >> android-developers+unsubscr...@googlegroups.com >>  cr...@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 Developer

[android-developers] BluetoothChat example and unsynchronized write

2011-01-12 Thread goosedroid
In the BluetoothChat demo (BluetoothChatService), there is a function
which performs an unsynchronized write to the ConnectedThread.write()
function. Its documented this way, so its clear that the developer did
this for a reason ... but I don't understand how this could work
reliably

public void write(byte[] out) {
// Create temporary object
ConnectedThread r;
// Synchronize a copy of the ConnectedThread
synchronized (this) {
if (mState != STATE_CONNECTED) return;
r = mConnectedThread;
}
// Perform the write unsynchronized
r.write(out);
}

ConnectedThead's write is not synchronized in any way.

Does anyone have any ideas?

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


  1   2   3   >