Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4android > Basic4android Updates and Questions
Documentation Wiki Register Members List Windows Mobile Search Today's Posts Mark Forums Read

Basic4android Updates and Questions Updates and questions regarding Basic4android.

Getting Device ID for Licensing

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-11-2012, 09:06 PM
Junior Member
 
Join Date: Dec 2010
Posts: 79
Default Getting Device ID for Licensing

I'm trying out the Licensing Library... I was originally playing around with the Phone library method of doing things, but I am now using the Unique ID method that uses the Reflection library found in this thread

I'm wondering what the syntax is to replace this line below:

Code:
lc.Initialize("lc", p.GetDeviceId, publicKey, "kljdflkf".GetBytes("UTF8"))
I've tried a few ways & can only get licensing to work when using the phone library (p.GetDeviceId).

Thanks!
Reply With Quote
  #2 (permalink)  
Old 04-12-2012, 05:27 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 25,807
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Have you tried replacing p.GetDeviceId with GetDeviceId? Which error do you get?
Reply With Quote
  #3 (permalink)  
Old 04-12-2012, 01:24 PM
Junior Member
 
Join Date: Dec 2010
Posts: 79
Default

Yes GetDeviceId is what I have been trying. I'm not actually getting an error - it seems like just no value being returned possibly.

For example I have placed a few toastmessages/msgboxes along the way as a trail - and I cannot seem to get a value for GetDeviceId or lc.SetVariableAndValue. At one point I had seen an "unknown" as a result for GetDeviceId (stock Samsung Galaxy S2 Epic 4G Touch). I didn't know if that was a problem in my code or it just can't determine the Id.

I am essentially using the Licensing library example and the Unique Id example together.

UPDATE: before submitting this reply, I was able to quickly test on an HTC EVO 4G - got a blank value for lc.SetVariableAndValue but did get a device ID for the HTC - also received an ID fine on a Kindle Fire.
Reply With Quote
  #4 (permalink)  
Old 04-12-2012, 03:35 PM
Junior Member
 
Join Date: Dec 2010
Posts: 79
Default

I did some more playing around and...

with API < 9 (As is in the example code)

Non-rooted stock ROM Samsung Galaxy S2 Epic 4G Touch - Unknown
Non-rooted stock ROM Kindle Fire - Device Id returned
Rooted HTC EVO 4G with stock ROM - Device Id returned
Rooted Kindle Fire with CM7 custom ROM - Unknown

when I set the API < 11

All 4 devices receive a random Id and go through the license check OK.

Is it feasible/recommended to bump up the API to 11 or just assign a random ID to all devices and skip the check? I saw that in another thread an "unknown" was also being reported by a Sony E Xperia Arc S. I would imagine there are quite a few Samsungs/Sonys out there plus others yet to be discovered that may report "unknown" and give a problem during the license check.
Reply With Quote
  #5 (permalink)  
Old 04-14-2012, 09:11 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 25,807
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Maybe you can add a check such as:
Code:
If id.EqualsIgnoreCase("unknown"Then [use other method]
Reply With Quote
  #6 (permalink)  
Old 04-16-2012, 01:57 AM
avacondios's Avatar
Junior Member
 
Join Date: Jan 2012
Location: Greece
Posts: 26
Send a message via Yahoo to avacondios Send a message via Skype™ to avacondios
Default

Not good idea to use the deviceID for license, since that you can change the deviceId from build.prop (if the device is rooted)
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Licensing library Erel Additional libraries, classes and official updates 18 10-17-2012 08:23 AM
Using Licensing Library Scantech Basic4android Updates and Questions 1 01-19-2012 01:53 PM
Licensing Library straybullet Basic4android Updates and Questions 8 01-18-2012 07:20 PM
Application Licensing splatt Basic4android Updates and Questions 17 10-08-2011 05:30 PM
wish: Application Licensing peacemaker Bugs & wishlist 0 06-27-2011 11:30 AM


All times are GMT. The time now is 09:20 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0