Can't make the Android project work with my keys

  13 posts   Feedicon  
Replies: 12 - Last Post: December 24, 2011 16:30
by: jaydude28
showing 1 - 13 of 13
 
Posted: December 20, 2011 17:01 by jaydude28
Hello,

I've downloaded the Android source to learn and build my own copy of TwAPIme. I'm using Eclipse 3.75 with the Android SDK. I have level 10 installed (2.3.3) with ADT tools v16. I unzipped the downloaded project toa folder and then imported it into Eclipse. I'm using the lib 1.8.2 which was just released yesterday or the day before I believe.

I open the oauth.properties in the raw folder inside Eclipse and edit the values to insert my consumer key and consumer secret keys. I also put in my callback url.

Then I launch the application while my Android device is plugged into my computer. The application starts up just fine. I click the sign-in button and I get the following error message:

"It was not possible to authenticate you. Would you like to try again?"

I thought maybe it was a problem with my keys. I entered them again making sure there were no leading spaces or anything. Still get the same error.

Single token access does not work for me either. Same error as above.

What am I doing wrong? Can someone please help me?
 
Posted: December 22, 2011 11:56 by Ernandes Mourao Junior
It does not even display the login page?
 
Posted: December 22, 2011 23:18 by jaydude28
Nope. I get that message over and over.
 
Posted: December 23, 2011 13:10 by Ernandes Mourao Junior
Hummm... Make sure the date/time/timezone is correct on your device/simulator. Once done, try it again!
 
Posted: December 23, 2011 17:37 by jaydude28
Okay.. got a little bit further this morning on this. Loaded up the project in Eclipse. Made sure I was using the libs for 1.8.2. This time around I got a red X error about something in the theme.xml file.

This is the line that the error occurs on.

<style name="TwAPImeThemeWindowTitle" parent="@android:style/WindowTitle"> The error is "error: Error retrieving parent for item: No resource found that matches the given name '@android:style/
WindowTitle'." If i remove the part parent="@android:style/WindowTitle" the error goes away and I'm able to run in via the simulator.

I created a new Twitter app via dev.twitter.com this morning and got a new set of keys. Plugged these into the oauth.properties and run it on my simulator. Clicked the sign in button, got the authorize you Twitter account screen. Entered my username and password then clicked Authorze App. Everything went good until it returned me to the app. The app FCed on me and that was it.

Not sure what I'm doing wrong here. I imagine it's something very simple. Perhaps related to me removing that line in the theme.xml file. Can you help me?
 
Posted: December 23, 2011 18:14 by jaydude28
I also decided to try single token access to just sign in as my twitter screen name and not authorize the app via my account. I changed the first set of lines back to default in the oauth.properties file.

I changed the first line to true with no brackets around it.

I changed the second set of lines to the keys provided to my by dev.twitter.com

I added 123456 for the user id

I entered my twitter username as the screename.

I loaded up the app onto my simulator and when it loaded it got the error of 'It was not possible to authenticate you. Would you like to try again?"

So as you can see, neither option is working for me at the moment.
 
Posted: December 23, 2011 19:01 by Ernandes Mourao Junior
Make sure your oauth.properties file looks like this:

twapime.oauth.consumer_key=dkajshdaksdhakjdhaks
twapime.oauth.consumer_secret=jdhaksdhaksdjhakdhaskdhakjd
twapime.oauth.callback_url=http://www.myurl.com

twapime.oauth.use_single_access_token=false

twapime.oauth.token=jahkajhkahakhakjhakjhakj
twapime.oauth.token_secret=akjhkajhakhakjhakja
twapime.oauth.user_id=123456

twapime.oauth.screen_name=your_user_name

Remove any brackets from your file. There are there to explain the key's domain.
 
Posted: December 23, 2011 19:57 by jaydude28
So let me make sure understand this ....

I need to fill in both sections of the oauth.properties file? Even if I'm going to do a single sign on?

And is it supposed to have the spaces between lines too?
 
Posted: December 24, 2011 15:09 by Ernandes Mourao Junior
Just enter the Single Access token info if you really going to use it. But this one is required:

twapime.oauth.use_single_access_token=false

No space is necessary. It was a formatting error by the forum.
 
Posted: December 23, 2011 20:17 by jaydude28
Okay.. tried putting all my info in the file and still getting a FC after it returns me to the application. Would it be helpful if I sent my project to you and you look and see what the problem is? Otherwise, I'm not getting anywhere with this.
 
Posted: December 23, 2011 20:38 by jaydude28
Okay... looking through Logcat inside Eclipse I see what's causing the FC error.....

12-23 14:35:41.314: E/AndroidRuntime(912): FATAL EXCEPTION: main
12-23 14:35:41.314: E/AndroidRuntime(912): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.twapime.app/com.twapime.app.activity.HomeActivity}: java.lang.NumberFormatException: unable to parse '[1...N seconds]' as integer
12-23 14:35:41.314: E/AndroidRuntime(912): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
12-23 14:35:41.314: E/AndroidRuntime(912): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
12-23 14:35:41.314: E/AndroidRuntime(912): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
12-23 14:35:41.314: E/AndroidRuntime(912): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
12-23 14:35:41.314: E/AndroidRuntime(912): at android.os.Handler.dispatchMessage(Handler.java:99)
12-23 14:35:41.314: E/AndroidRuntime(912): at android.os.Looper.loop(Looper.java:123)
12-23 14:35:41.314: E/AndroidRuntime(912): at android.app.ActivityThread.main(ActivityThread.java:3683)
12-23 14:35:41.314: E/AndroidRuntime(912): at java.lang.reflect.Method.invokeNative(Native Method)
12-23 14:35:41.314: E/AndroidRuntime(912): at java.lang.reflect.Method.invoke(Method.java:507)
12-23 14:35:41.314: E/AndroidRuntime(912): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
12-23 14:35:41.314: E/AndroidRuntime(912): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
12-23 14:35:41.314: E/AndroidRuntime(912): at dalvik.system.NativeStart.main(Native Method)
12-23 14:35:41.314: E/AndroidRuntime(912): Caused by: java.lang.NumberFormatException: unable to parse '[1...N seconds]' as integer
12-23 14:35:41.314: E/AndroidRuntime(912): at java.lang.Integer.parse(Integer.java:383)
12-23 14:35:41.314: E/AndroidRuntime(912): at java.lang.Integer.parseInt(Integer.java:372)
12-23 14:35:41.314: E/AndroidRuntime(912): at java.lang.Integer.parseInt(Integer.java:332)
12-23 14:35:41.314: E/AndroidRuntime(912): at com.twapime.app.TwAPImeApplication.getGAInterval(TwAPImeApplication.java:165)
12-23 14:35:41.314: E/AndroidRuntime(912): at com.twapime.app.activity.HomeActivity.onCreate(HomeActivity.java:56)
12-23 14:35:41.314: E/AndroidRuntime(912): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
12-23 14:35:41.314: E/AndroidRuntime(912): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
12-23 14:35:41.314: E/AndroidRuntime(912): ... 11 more
 
Posted: December 24, 2011 15:11 by Ernandes Mourao Junior
I know the reason of this error. It is because you are not setting the Google Analytics account info.

res/raw/google_analytics.properties

Fill it out with something like this:

twapime.ga.account_id=UA-0000000-00
twapime.ga.interval=30
 
Posted: December 24, 2011 16:30 by jaydude28
Thanks man for all of your help! Changing those two values makes the app work! Don't know why I overlooked those.

One last question, I promise. Where would I look to make the url in a tweet clickable? I'm still learning java and android development.
showing 1 - 13 of 13
Replies: 12 - Last Post: December 24, 2011 16:30
by: jaydude28
  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2010, Oracle Corporation and/or its affiliates
(revision 20120518.3c65429)
 
 
Close
loading
Please Confirm
Close