And my point is that you are not using the fully qualified path to the
ANDROID_ID.   I KNOW my function works.   That part is only there for use on
the emulator.  Otherwise I would have many people complaining.

Feel free to use it or not.  I was just trying to help.   I saw a flaw in
your design and offered another solution that works.


On Thu, Jan 28, 2010 at 1:03 PM, flsobral <[email protected]> wrote:

> Still, if I use your function I'll get the same string from different
> devices of the same model.
> Eg:
> All users using Google Ion will return this string:
> "xxxx" + "google_ion" + "a23456790112345b"
>
> It also doesn't matter if I use the class full name or not - and it
> really shouldn't, but I tried it anyway and still received null.
>
> As I said before, I can use Settings.System and Settings.Secure to
> retrieve any value, except for the ANDROID_ID that always comes null.
>
>
> On Jan 28, 6:15 pm, Wayne Wenthin <[email protected]> wrote:
> > It returns a unique string based on both
> > the android.provider.Settings.Secure.ANDROID_ID and
> > the android.os.Build.PRODUCT along with a unique code for my app (just
> > incase I want to build another)  I am pretty sure the issue stated above
> is
> > a result of not using the full android.provider.Setting.Secure.ANDROID_ID
> > and instead relying on just this:  Secure.ANDROID_ID .  This is probably
> why
> > it is returning NULL but I'm not positive.  I do know that my analytics
> is
> > showing session both from the HTC Magic even labeled as the ION and the
> > Milestone along with quite a few others.  Granted I'm not seeing alot of
> > traffic an the ION.
> >
> >
> >
> >
> >
> > On Thu, Jan 28, 2010 at 9:31 AM, theSmith <[email protected]>
> wrote:
> >
> > > On Jan 28, 11:34 am, Wayne Wenthin <[email protected]> wrote:
> > > > I have a function for this since I munge up the android id and I need
> an
> > > > androidid for the emulator so I make one up.   Hope this helps.
> >
> > > > public String getandroidid() {
> > > > String AndroidID = System.getString(this.getContentResolver(),
> > > > android.provider.Settings.Secure.ANDROID_ID);
> > > > if (AndroidID == null)
> > > > AndroidID = "a23456790112345b";
> > > > String Android_ID = "xxxx" + android.os.Build.PRODUCT + AndroidID;
> > > > return Android_ID;
> >
> > > Wouldn't this just return the same String on multiple devices? Which
> > > defeats the purpose because the Android_Id is supposed to be unique.
> > > Also there is no reason that this shouldn't be working on those
> > > devices, can anyone confirm this on those devices?
> >
> > > -theSmith
> >
> > > > }
> > > > On Thu, Jan 28, 2010 at 6:14 AM, flsobral <[email protected]>
> wrote:
> > > > > Hello.
> >
> > > > > I'm trying to get the ANDROID_ID on two different devices but it
> > > > > always return null on both.
> > > > > I'm using a Google Ion (aka HTC Magic) with firmware 1.6 and a
> > > > > Motorola Milestone with firmware 2.0.
> >
> > > > > I've been using this small sample to show the id, but it always
> shows
> > > > > null:
> >
> > > > >    public void onCreate(Bundle savedInstanceState)
> > > > >    {
> > > > >        super.onCreate(savedInstanceState);
> > > > >        setContentView(R.layout.main);
> >
> > > > >        Toast.makeText(this, "ANDROID_ID: " + Secure.getString
> > > > > (getContentResolver(), Secure.ANDROID_ID),
> >
> > > > >             Toast.LENGTH_LONG).show();
> > > > >    }
> >
> > > > > Any suggestions?
> >
> > > > > Thanks in advance.
> >
> > > > > --
> > > > > You received this message because you are subscribed to the Google
> > > > > Groups "Android Developers" group.
> > > > > To post to this group, send email to
> > > [email protected]
> > > > > To unsubscribe from this group, send email to
> > > > > [email protected]<android-developers%[email protected]><android-developers%2Bunsubs
> [email protected]>
> > > <android-developers%[email protected]<android-developers%[email protected]><android-developers%252Bu
> [email protected]>
> >
> > > > > For more options, visit this group at
> > > > >http://groups.google.com/group/android-developers?hl=en
> >
> > > > --
> > > > Writing code is one of few things
> > > > that teaches me I don't know everything.
> >
> > > > Join the Closed Beta of Call Girl Managerhttp://
> www.fuligin.com/forums
> >
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "Android Developers" group.
> > > To post to this group, send email to
> [email protected]
> > > To unsubscribe from this group, send email to
> > > [email protected]<android-developers%[email protected]><android-developers%2Bunsubs
> [email protected]>
> > > For more options, visit this group at
> > >http://groups.google.com/group/android-developers?hl=en
> >
> > --
> > Writing code is one of few things
> > that teaches me I don't know everything.
> >
> > Join the Closed Beta of Call Girl Managerhttp://www.fuligin.com/forums
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Writing code is one of few things
that teaches me I don't know everything.

Join the Closed Beta of Call Girl Manager
http://www.fuligin.com/forums

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

Reply via email to