|
Posts: 16
Registered: Jul 18, 2012
|
Posted: 2012-07-19 10:18:45
|
Can I use the EchoNest on Android with jEN.jar ?
I tried it but it doesn't work ,
How do I use EchoNest on Android ?
|
|
|
Posts: 926
Registered: Sep 08, 2008
|
Posted: 2012-07-19 13:31:33
|
Lukelu1231 - We know of folks who have used the jEN API on Android. One common problem we see for Android developers is that they fail to include the json-simple jar file (which is required for jen). Look for json_simple-1.1.jar in the lib directory of the jEN distribution and make sure it is included in your Android build. -- Paul
|
|
|
Posts: 16
Registered: Jul 18, 2012
|
Posted: 2012-07-20 05:27:54
|
I use the jEN.jar in java, and run the example "SimilarArtists" , it shows the result in the Console window. But in Android I cannot get the result by changing "System.out.println" to "TextView1.setText()" ? How can I use with json_simple-1.1.jar ?
|
|
|
Posts: 16
Registered: Jul 18, 2012
|
Posted: 2012-07-20 08:27:25
|
Do you have example code that give command to Echonest on Android ? Thank you .
|
|
|
Posts: 16
Registered: Jul 18, 2012
|
Posted: 2012-07-20 10:04:31
|
The response of "SimilarArtist Example" is not in json format , isn't it ?
|
|
|
Posts: 926
Registered: Sep 08, 2008
|
Posted: 2012-07-20 18:17:37
|
Hi Lukelue1231 - If you are able to see similar artists results in the console window, then I think you have the API working on Android properly. To get the results displayed via android widgets with textview.setText is something you'd best ask on an Android support forum. And no, the output of the SimilarArtist example is just simple text, it is not Json. -- Paul
|
|
|
Posts: 16
Registered: Jul 18, 2012
|
Posted: 2012-07-23 04:47:58
|
Hello , thank you for the previous reply.
It's ok when I use "echoNest.getMinCommandTime()", because the return of it is an int type. But it gets error when I use "echoNest.newArtistByName()" , because the return of it is a "Artist" object? But Everything in the java project can run, so I think the problem is this...
|
|
|
Posts: 16
Registered: Jul 18, 2012
|
Posted: 2012-07-23 06:36:33
|
do you know any android example that uses Echonest ?
|
|
|
Posts: 16
Registered: Jul 18, 2012
|
Posted: 2012-07-23 07:01:30
|
I think I don't have my API working on Android properly, because it still goes error if I use system.out.println(). The "echoNest.getMinCommandTime()" need not to link to Echonest, so it doesn't go error, right?
|
|
|
Posts: 16
Registered: Jul 18, 2012
|
Posted: 2012-07-23 07:47:13
|
in my Android project , as the program executes "Artist aqua = echoNest.searchArtists("Aqua").get(0);" , I find the message in my LogCat : Sending 1 51 1343028215014--> http://developer.echonest.com/api/v4/artist/search?name=Aqua&api_key=P3A9** , , and the next message show "thread exiting with uncaught exception". I browse this website and I find the informations for Aqua(a singer) in json format , I guess that means in my Android project it can successfully use the API_KEY and link to Echonest, but it fails to change the json informations to "Artist" object ...
|
|
|
Posts: 16
Registered: Jul 18, 2012
|
Posted: 2012-08-03 03:49:29
|
Add the following to onCreate() so that we can use jEN.jar on Android :
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
.detectDiskReads()
.detectDiskWrites()
.detectNetwork() // or .detectAll() for all detectable problems
.penaltyLog()
.build());
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
.detectLeakedSqlLiteObjects()
.detectLeakedClosableObjects()
.penaltyLog()
.penaltyDeath()
.build())
|
|