Android Twitter App

by quique123 » Fri, 20 May 2011 10:37:40 GMT


Sponsored Links
 Ive been wrestling with this and it seems there is much confusion online 
about this.  Marakana has this code:

1.  https://github.com/marakana/OAuthDemo : Which is a very simple OAuthDemo 
Project in github.

2.   http://marakana.com/static/tutorials/MyTwitter-Part4.zip  : Which is a 
more complete Project at marakana website.

Neither project works on eclipse.  I get the unauthorized 401 error.  My 
twitter account is working fine, i use it daily.
Whats also confusing is that in #1, we use a Twitter-registered Application 
with Key & secret & callbackURL which seems logical.  In #2 however, I have 
been unable to find where in the app that is stored, in order to modify it 
to use my Twitter-registered Application...Any insight?  Pls hlp.

-- 



Re: Android Twitter App

by TreKing » Fri, 20 May 2011 10:50:20 GMT


 




Any insight?


Ask Marakana? This has nothing to do with Android Development using the SDK,
which is what this group is for.

-------------------------------------------------------------------------------------------------
TreKing < http://sites.google.com/site/rezmobileapps/treking> ; - Chicago
transit tracking app for Android-powered devices

-- 


Sponsored Links


Other Threads

1. SharedPreferences.getFloat throwing ClassCastException

My preference is described in preferences.xml like this:

<EditTextPreference android:key="maxTempDegrees"
android:summary="Maximum temperature" android:title="Max Temp"
android:persistent="true" android:defaultValue="100"
android:inputType="numberDecimal"></EditTextPreference>

This behaves very nicely in the preferences view, only allowing the
user to enter valid decimal numbers.

However, when I call SharedPreferences.getFloat with the
"maxTempDegrees" key, it throws a ClassCastException. Beyond the
inputType key, how can I tell getFloat to parse the user input as a
long?

By the way, I did some experimentation and the only "get" method that
worked was getLong. I was hoping to use getString and parse it myself
but that's not an option either. How do people handle float
preferences?

-- 

2. Consolidating two SharedPreferences issues.

I've got two different threads going here and it looks like the two
issues are related. There's something fundamentally broken in my
implementation of SharedPreferences. One thread is entitled
"SharedPreferences.getFloat throwing ClassCastException " and the
other is "Default values for ListPreference ". Here are the symptoms:

First SharedPreferences.getInt and SharedPreferences.getFloat are both
throwing ClassCastException. SharedPreferences.getBoolean is working
fine. In addition, ListPreference is stopping with an uncaught
exception when I attempt to set the preference from the screen, but
only if there is a defaultValue set.

Is it possible that I've left off some SharedPreferences housekeeping?

Here's how I get the SharedPreferences object (in Service.onCreate)
when I'm setting up to call getInt, getFloat, etc:

                myPreferences =
PreferenceManager.getDefaultSharedPreferences( getApplicationContext() );

Here's how I launch the preferences editor from my main Activity
screen:

                startActivity( new
Intent( Intent.ACTION_VIEW 
).setClass(getApplicationContext(),Preferences.class) );

Is there anything I'm missing that might be causing these behaviors?

Here's preferences.xml:

<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
  xmlns:android="http://schemas.android.com/apk/res/android">
        <PreferenceCategory android:title="Event Settings"
android:summary="Enable/Disable Events" android:key="EventSettings">
                <CheckBoxPreference
                        android:key="enableDrop"
android:defaultValue="true" android:summary="Detect Dropped Package"
android:title="Drop" android:persistent="true"/>
        <CheckBoxPreference android:defaultValue="true"
android:title="Tip" android:summary="Detect Upset Package"
android:key="enableTip" android:persistent="true"></
CheckBoxPreference>
<CheckBoxPreference android:key="enableFix"
android:defaultValue="false" android:title="Fix"
android:summary="Generate Position Fixes" android:persistent="true"></
CheckBoxPreference>
<CheckBoxPreference android:key="enableOvertemp"
android:defaultValue="false" android:title="Too Hot"
android:summary="Detect excessive heat" android:persistent="true"></
CheckBoxPreference>
<CheckBoxPreference android:key="enableUndertemp"
android:defaultValue="false" android:title="Too Cold"
android:summary="Detect excessive cold" android:persistent="true"></
CheckBoxPreference>
<CheckBoxPreference android:key="enableOpen"
android:defaultValue="false" android:title="Open"
android:summary="Detect package opened" android:persistent="true"></
CheckBoxPreference>
</PreferenceCategory>
        <PreferenceCategory android:title="Basic Parameters"
android:key="BasicParameters">
<EditTextPreference android:key="maxForceGs" android:summary="Maximum
G-force loading" android:title="Max Force" android:persistent="true"
android:inputType="numberDecimal" android:defaultValue="10F"></
EditTextPreference>
<EditTextPreference android:key="maxTipDegrees"
android:summary="Maximum tip angle" android:title="Max Tip"
android:persistent="true" android:inputType="numberDecimal"
android:defaultValue="45F"></EditTextPreference>
<EditTextPreference android:key="maxTempDegrees"
android:summary="Maximum temperature" android:title="Max Temp"
android:persistent="true" android:inputType="numberDecimal"
android:defaultValue="100F"></EditTextPreference>
<EditTextPreference android:key="minTempDegrees"
android:summary="Minimum temperature" android:title="Min Temp"
android:persistent="true" android:inputType="numberDecimal"
android:defaultValue="35F"></EditTextPreference>
<ListPreference android:entryValues="@array/tempUnitsInts"
android:entries="@array/tempUnitsNames" android:title="Units"
android:key="TempUnits" android:summary="Temperature Units"
android:persistent="true"></ListPreference>
<EditTextPreference android:key="fixPeriod" android:summary="Seconds
between location fixes" android:title="Fix Period"
android:persistent="true" android:inputType="numberDecimal"
android:defaultValue="1800F"></EditTextPreference>
</PreferenceCategory>
<PreferenceCategory android:title="Advanced Parameters"
android:key="AdvancedParameters">
<EditTextPreference android:key="maxForceHystPercent"
android:summary="G-force hysteresis" android:title="Force Hyst"
android:persistent="true" android:inputType="numberDecimal"
android:defaultValue="20F"></EditTextPreference>
<EditTextPreference android:key="maxTipHystDegrees"
android:summary="Maximum tip angle hysteresis" android:title="Tip
Hyst" android:persistent="true" android:inputType="numberDecimal"
android:defaultValue="10F"></EditTextPreference>
<EditTextPreference android:key="tempHystDegrees"
android:summary="Over/undertemp hysteresis" android:title="Temp Hyst"
android:persistent="true" android:inputType="numberDecimal"
android:defaultValue="5F"></EditTextPreference>
<EditTextPreference android:key="maxLightHystPercent"
android:summary="Percentage of hysteresis in light sensor"
android:title="Light Hyst" android:persistent="true"
android:inputType="numberDecimal" android:defaultValue="20F"></
EditTextPreference>
<EditTextPreference android:key="maxTempHystPercent"
android:title="Max Temp Hyst" android:persistent="true"
android:inputType="numberDecimal" android:defaultValue="10F"></
EditTextPreference>
<EditTextPreference android:key="minTempHystPercent"
android:title="Min Temp Hyst" android:persistent="true"
android:inputType="numberDecimal" android:defaultValue="10F"></
EditTextPreference>
</PreferenceCategory>
</PreferenceScreen>

Here's arrays.xml:

<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="tempUnitsNames"><item>Celsius</item>
<item>Fahrenheit</item>
</string-array>
<integer-array name="tempUnitsInts"><item>1</item>
<item>2</item>
</integer-array>
</resources>

Here's the logcat stack trace from the attempt to set the list
selection from the screen when a default value is selected:

I/ActivityManager(   53): Displayed activity
com.shipmate/.Preferences: 1158 ms
(total 1158 ms)
D/dalvikvm(  230): GC freed 3166 objects / 177680 bytes in 133ms
D/AndroidRuntime(  230): Shutting down VM
W/dalvikvm(  230): threadid=3: thread exiting with uncaught exception
(group=0x4
001b188)
E/AndroidRuntime(  230): Uncaught handler: thread main exiting due to
uncaught e
xception
E/AndroidRuntime(  230): java.lang.NullPointerException
E/AndroidRuntime(  230):        at
android.preference.ListPreference.findIndexOf
Value(ListPreference.java:169)
E/AndroidRuntime(  230):        at
android.preference.ListPreference.getValueInd
ex(ListPreference.java:178)
E/AndroidRuntime(  230):        at
android.preference.ListPreference.onPrepareDi
alogBuilder(ListPreference.java:190)
E/AndroidRuntime(  230):        at
android.preference.DialogPreference.showDialo
g(DialogPreference.java:294)
E/AndroidRuntime(  230):        at
android.preference.DialogPreference.onClick(D
ialogPreference.java:265)
E/AndroidRuntime(  230):        at
android.preference.Preference.performClick(Pr
eference.java:811)
E/AndroidRuntime(  230):        at
android.preference.PreferenceScreen.onItemCli
ck(PreferenceScreen.java:190)
E/AndroidRuntime(  230):        at
android.widget.AdapterView.performItemClick(A
dapterView.java:284)
E/AndroidRuntime(  230):        at
android.widget.ListView.performItemClick(List
View.java:3285)
E/AndroidRuntime(  230):        at android.widget.AbsListView
$PerformClick.run(A
bsListView.java:1640)
E/AndroidRuntime(  230):        at
android.os.Handler.handleCallback(Handler.jav
a:587)
E/AndroidRuntime(  230):        at
android.os.Handler.dispatchMessage(Handler.ja
va:92)
E/AndroidRuntime(  230):        at android.os.Looper.loop(Looper.java:
123)
E/AndroidRuntime(  230):        at
android.app.ActivityThread.main(ActivityThrea
d.java:4363)
E/AndroidRuntime(  230):        at
java.lang.reflect.Method.invokeNative(Native
Method)
E/AndroidRuntime(  230):        at
java.lang.reflect.Method.invoke(Method.java:5
21)
E/AndroidRuntime(  230):        at com.android.internal.os.ZygoteInit
$MethodAndA
rgsCaller.run(ZygoteInit.java:860)
E/AndroidRuntime(  230):        at
com.android.internal.os.ZygoteInit.main(Zygot
eInit.java:618)
E/AndroidRuntime(  230):        at
dalvik.system.NativeStart.main(Native Method)

I/Process (   53): Sending signal. PID: 230 SIG: 3
I/dalvikvm(  230): threadid=7: reacting to signal 3
I/dalvikvm(  230): Wrote stack trace to '/data/anr/traces.txt'

-- 

3. changing the shape of buttons

4. Flickr and Facebook

5. ADB over TCP/IP?

6. Manifest android:versionCode question

7. android:clickable = true makes layout not clickable?