How-To: Using Twitter API ME with Java ME SDK 3.0
Replies: 17 - Last Post: September 07, 2010 12:13
by: Ernandes Mourao Junior
by: Ernandes Mourao Junior
showing 1 - 18 of 18
Ernandes Mourao Junior
|
Posted: August 05, 2010 13:10 by Ernandes Mourao Junior
|
|
Hi Terrence, Thanks for this great tutorial! For sure, it will be a great asset for this project. Regards, Ernandes |
pradeep034045123
|
Posted: August 21, 2010 09:39 by pradeep034045123
|
|
Hi Terrence, I used Twitter api with Lwuit. It works fine in the simulator. but I doesnt work in nokia 95. But I didnt use Auth Api. Can any one tel me where can i fine XAuth.jar. can u please give me a link to download it. Thanks and Regards, Pradeep |
Ernandes Mourao Junior
|
Posted: August 22, 2010 19:50 by Ernandes Mourao Junior
|
|
Hi Pradeep, There is no such xAuth.jar you mentioned. Twitter API ME 1.3 already supports xAuth. To authenticate with using xAuth, please, check the section "Verify User's Credentials" in our Wiki page: http://kenai.com/projects/twitterapime/pages/Home#VerifyUserCreds Regards, Ernandes |
pradeep034045
|
Posted: August 24, 2010 04:31 by pradeep034045
|
|
Hi ernandes, Thanks for the quick reply. Now I registerd my application at twitter. and I got the consumer key and secret key. What I did was I passed those keys to the constructor like the following Credential credential = new Credential(user, pwd,Constants.twitConsumerKey,Constants.twitConsumerSecretKey); but I get the follwing exception, subject alternative name did not match site name Can u tel me how can I use that consumer key and secret key Thanks in advance. |
Ernandes Mourao Junior
|
Posted: August 24, 2010 11:13 by Ernandes Mourao Junior
|
|
Now you have to request to api@twitter.com priveliges to your app to use your xauth keys. However, they are not providing it for personal test purposes. If it is your case, I ask you to wait for versin 1.4, where I am implementing a solution to avoid this step on xAuth usage. Regarding the excetion message you mentioned, check this thread: http://kenai.com/projects/twitterapime/forums/forum/topics/3113-oAuth-J2ME-Certificate-Error Regards, Ernandes |
pradeep034045
|
Posted: September 01, 2010 07:23 by pradeep034045
|
|
Hi, Erandes, Thanks for u r immediate reply, but, Im using TwitterMe api for my mobile application, I registered my application in twitter and got the consumer key and the secret key. and got the priveliges also but The problem Im having is after I post a twit it gives an exception which tells "javax.microedition.pki.CertificateException: Subject alternative name did not match site name" This is how I do the post. Credential credential = new Credential(user, pwd,Constants.twitConsumerKey,Constants.twitConsumerSecretKey); UserAccountManager userAccMgr = UserAccountManager.getInstance(credential); if (userAccMgr.verifyCredential()) { Tweet tweet = new Tweet(message); TweetER tweeter = TweetER.getInstance(userAccMgr); tweet = tweeter.post(tweet); DialogFrame frame = new DialogFrame(); frame.setTitle("Twitter"); frame.setBody("Successfully Twitted!"); frame.createUI(2); } and also what are these urls for? Request token URL Access token URL Authorize URL pls some body help me. Thanks in advance. pradeep. |
Ernandes Mourao Junior
|
Posted: September 01, 2010 11:17 by Ernandes Mourao Junior
|
|
Hi, Your code looks fine. Please, see this thread: http://kenai.com/projects/twitterapime/forums/forum/topics/3113-oAuth-J2ME-Certificate-Error Regards, Ernandes |
pradeep034045
|
Posted: September 02, 2010 05:33 by pradeep034045
|
|
Hi, Thanks for the reply, pls tel me how can I use Http to avoid that certification problem. Thanks & regards, Pradeep. |
Ernandes Mourao Junior
|
Posted: September 02, 2010 11:43 by Ernandes Mourao Junior
|
| The only method that access Twitter API using HTTPS is the UserAccountManager.verifyCredential(), when your are using xAuth. We must work that way. However, if you use Single Access token, this access is bypassed and you can test on emulator without problems. But remender it is just a workaround for this issue. |
pradeep034045
|
Posted: September 03, 2010 01:53 by pradeep034045
|
|
HI, thanks for ur immediate reply, How can I use that single access token to avoid that, pls tel me how to do that. thanks pradeep. |
pradeep034045
|
Posted: September 03, 2010 09:41 by pradeep034045
|
|
how can I get equifax certificate and does it support to WTK 2.5.2 Thanks, Pradeep |
netroboost
|
Posted: September 03, 2010 10:00 by netroboost
|
|
Pradeep, Installing Equifax certificate will not help since WTK 2.5.2 does not accept wild card certificates. That is, it would have recognized http://twitter.com but since we are communicating with http://api.twitter.com it will reject that domain. To bypass this, here is one way of approaching it: 1. Use the source code of TWAPIME instead of the packaged library. 2. Go to com->twitterapime->rest ->UserAccountManager.java 3. Search for "https://api.twitter.com/oauth/access_token" 4. Change the https to http It should work fine. Amit. |
Ernandes Mourao Junior
|
Posted: September 03, 2010 11:27 by Ernandes Mourao Junior
|
|
Amit, You do not need to change the source code to do that. There is a method in UserAccountManager class where you can replace the urls used by API. See below: UserAccountManager.setServiceURL( UserAccountManager.TWITTER_API_URL_SERVICE_OAUTH_ACCESS_TOKEN, "http://api.twitter.com/oauth/access_token" ); To let it clear, Twitter API recommends the use of HTPS for this endpoint. Pradeep, To auth with Single Access token, see our wiki: http://kenai.com/projects/twitterapime/pages/Home#VerifyUserCreds Regards, Ernandes |
pradeep034045
|
Posted: September 06, 2010 06:43 by pradeep034045
|
|
HI, Eranandes, Thanks to ur reply. It works fine in the emulator. But when I install that in to my phone, it doesnt work. pls tel me what do i do. Thanks, Pradeep. |
pradeep034045
|
Posted: September 07, 2010 03:18 by pradeep034045
|
|
HI Amith, this is working fine in emulator , but after installing that application in my mobile phone, it doesnt work. Pls help me to correct that problem. Thanks, Pradeep. |
Ernandes Mourao Junior
|
Posted: September 07, 2010 12:13 by Ernandes Mourao Junior
|
|
Pradeep, Please, send an e-mail to support@twapime.com explaining your situation so I can help you. This thread is so confuse at this point. As soon as we solve it, we post the conversation here in the forum, in order to help other developers. Regards, Ernandes |
mopuruvinod
|
Posted: September 06, 2010 04:32 by mopuruvinod
|
|
Hi Terrence, I imported the libraries: xauth-encoders.jar kxml2-min-2.3.0.jar, mobile-ju-framework-1.0.jar twitter_api_me-1.3.jar After using Ernandes library i am receiving errors as below I used single access token here verification of credentials are successfull. but failed to Tweet received below errors In WTK 3.0 javax.microedition.io.ConnectionNotFoundException: ConnectionNotFound error in socket::open : error = 10060 In WTK 2.5.2 java.lang.SecurityException: Invalid / expired Token Source is as follows: Token token = new Token("token_access", "token_secret"); Credential c = new Credential("mopuruvinodreddy@gmail.com", "8oHIBK7T90Ye7GjIF6SToA", "4Ebm4f7bie2AAYyN75DxwSUYeg8x0SBlL0IyKIXzaw", token); UserAccountManager m = UserAccountManager.getInstance(c); try { if (m.verifyCredential()) { System.out.println("Consumer or token keys are success"); Tweet t = new Tweet("Hi!!! This is my first tweet via Twitter API ME."); TweetER ter = TweetER.getInstance(m); t = ter.post(t); } else { System.out.println("Consumer or token keys are invalid!"); } } catch (Exception ex) { System.out.println("Exception here1="+ex); } If i use normal credentials my application is not able to validate credentials itself In WTK 3.0 javax.microedition.io.ConnectionNotFoundException: ConnectionNotFound error in socket::open : error = 10060 In WTK 2.5.2 Credentials unsucessfull Also when i am not able to import Equifax cert Please help to authentication, post and receive tweets using my application. Regards, Vinod |
showing 1 - 18 of 18
Replies: 17 - Last Post: September 07, 2010 12:13
by: Ernandes Mourao Junior
by: Ernandes Mourao Junior








