Re: [twitter-dev] BlackBerry, XAuth and twitterapime

2010-08-06 Thread Ernandes Jr.
BB is powered by Java ME and some specific RIM Java APIs.

On Fri, Aug 6, 2010 at 8:26 AM, David Francisco Tavárez 
davidftava...@gmail.com wrote:

 Twitter4J do not run on BB.

 2010/8/6, Bess bess...@gmail.com:
  I am able to use Twitter4J Oauth in Android SDK 2.1. Can you do the
  same on BB?
 
  Does BB has the same JAVA environment similar to Android? I assume
  J2SE is very different than Android Java?
 
  On Aug 5, 4:52 pm, BBTweet Media Player bbtweetme...@gmail.com
  wrote:
  Ernandes,
 
  Thanks for the response.  I am sure there is something small I am
  doing wrong.  I did grab twitter4j and made a simple j2se app to make
  sure I could use my consumer key and secret and XAuth worked.  So I
  know my account is good at least.  I am now trying to hand code the
  example onhttp://dev.twitter.com/pages/xauthto make sure I can
  properly encode a header. Everything worked fine using BASIC.  I do
  not see why they had to make it so hard.
 
  I am using the BB 5 and 6 OSs.
 
  On Aug 5, 2:39 pm, Ernandes Jr. ernan...@gmail.com wrote:
 
   I do not have a BB to test the API. However, I have received some
   e-mails
   from people facing same problem as you. Some of them were making some
   small
   mistakes and then it worked, however, others did not have much
 success.
   At
   this moment, I am trying to find the route cause of many problems with
   BB. I
   hope to find it soon and then release a fix for release 1.4.
 
   By the way. which is your BB's OS version?
 
   Regards,
   Ernandes
 
   On Thu, Aug 5, 2010 at 4:56 AM, Bess bess...@gmail.com wrote:
Which OAuth library did you use on your BB? Did you use the Java
library?
 
On Aug 4, 7:42 am, Ernandes Jr. ernan...@gmail.com wrote:
 Hi,
 
 I suggest you to get in touch to Twitter API ME support before
 replacing
 codes. Send an e-mail to supp...@twapime.com or check project's
 forum
page:http://kenai.com/projects/twitterapime/forums/forum
 
 Maybe your issues are already discussed there.
 
 Regards,
 Ernandes
 
 On Tue, Aug 3, 2010 at 9:21 PM, BBTweet Media Player 
bbtweetme...@gmail.com
 
  wrote:
  I am having a very difficult time trying to get XAuth working in
  my
  BlackBerry app.  I have downloaded twitterapime the hmacsha
  ecodingand
  Base64Ecoder did not seem to work for me so I replaced the
  getSignature method in XAuthSigner with...
 
  /**
  * p
  * Generate a signature from the given base string.
  * /p
  * @param baseString Base string.
  * @param consumerSecret Consumer secret.
  * @param tokenSecret Token secret.
  * @return Signature.
  */
 private static String getSignature(String baseString,
  String
  consumerSecret,
 String tokenSecret) {
  //  byte[] b = HMAC.getHmac(baseString,
 consumerSecret
  +
'' +
  tokenSecret);
  //  //
  //  return Base64Encoder.encode(b);
 String ret = null;
 try {
 ret = hmacsha1(baseString, consumerSecret
 +
  ''
+
  tokenSecret);
 } catch (Exception e) {
 new RuntimeException(e.getMessage());
 }
 return ret;
 }
 
 private static String hmacsha1(String key, String
 message)
 throws CryptoTokenException,
CryptoUnsupportedOperationException,
  IOException {
   HMACKey k = new HMACKey(key.getBytes());
   HMAC hmac = new HMAC(k, new SHA1Digest());
   hmac.update(message.getBytes());
   byte[] mac = hmac.getMAC();
   return Base64OutputStream.encodeAsString(mac, 0,
  mac.length, false, false);
 }
 
  and any  base 64 encodings with
  Base64OutputStream.encodeAsString(mac,
  0, mac.length, false, false);
 
  I get 401 errors when attempting to get my request token.
 
  I can replace my secrets, ids and pass with dummys and place a
  step by
  steps of what is going on if that would help?
 
 --
 Ernandes Jr.
 -
 ALL programs are poems. However,
 NOT all programmers are poets.
 
   --
   Ernandes Jr.
   -
   ALL programs are poems. However,
   NOT all programmers are poets.

 --
 Enviado desde mi dispositivo móvil

 David F. Tavárez
 
 Software Developer
 http://www.davidtavarez.com/
 http://twitter.com/davidtavarez
 http://www.facebook.com/davidtavarez




-- 
Ernandes Jr.
-
ALL programs are poems. However,
NOT all programmers are poets.


Re: [twitter-dev] BlackBerry, XAuth and twitterapime

2010-08-04 Thread Ernandes Jr.
Hi,

I suggest you to get in touch to Twitter API ME support before replacing
codes. Send an e-mail to supp...@twapime.com or check project's forum page:
http://kenai.com/projects/twitterapime/forums/forum

Maybe your issues are already discussed there.

Regards,
Ernandes

On Tue, Aug 3, 2010 at 9:21 PM, BBTweet Media Player bbtweetme...@gmail.com
 wrote:

 I am having a very difficult time trying to get XAuth working in my
 BlackBerry app.  I have downloaded twitterapime the hmacsha ecodingand
 Base64Ecoder did not seem to work for me so I replaced the
 getSignature method in XAuthSigner with...

 /**
 * p
 * Generate a signature from the given base string.
 * /p
 * @param baseString Base string.
 * @param consumerSecret Consumer secret.
 * @param tokenSecret Token secret.
 * @return Signature.
 */
private static String getSignature(String baseString, String
 consumerSecret,
String tokenSecret) {
 //  byte[] b = HMAC.getHmac(baseString, consumerSecret + '' +
 tokenSecret);
 //  //
 //  return Base64Encoder.encode(b);
String ret = null;
try {
ret = hmacsha1(baseString, consumerSecret + '' +
 tokenSecret);
} catch (Exception e) {
new RuntimeException(e.getMessage());
}
return ret;
}


private static String hmacsha1(String key, String message)
throws CryptoTokenException, CryptoUnsupportedOperationException,
 IOException {
  HMACKey k = new HMACKey(key.getBytes());
  HMAC hmac = new HMAC(k, new SHA1Digest());
  hmac.update(message.getBytes());
  byte[] mac = hmac.getMAC();
  return Base64OutputStream.encodeAsString(mac, 0,
 mac.length, false, false);
}

 and any  base 64 encodings with Base64OutputStream.encodeAsString(mac,
 0, mac.length, false, false);

 I get 401 errors when attempting to get my request token.

 I can replace my secrets, ids and pass with dummys and place a step by
 steps of what is going on if that would help?




-- 
Ernandes Jr.
-
ALL programs are poems. However,
NOT all programmers are poets.


[twitter-dev] BlackBerry, XAuth and twitterapime

2010-08-03 Thread BBTweet Media Player
I am having a very difficult time trying to get XAuth working in my
BlackBerry app.  I have downloaded twitterapime the hmacsha ecodingand
Base64Ecoder did not seem to work for me so I replaced the
getSignature method in XAuthSigner with...

/**
 * p
 * Generate a signature from the given base string.
 * /p
 * @param baseString Base string.
 * @param consumerSecret Consumer secret.
 * @param tokenSecret Token secret.
 * @return Signature.
 */
private static String getSignature(String baseString, String
consumerSecret,
String tokenSecret) {
//  byte[] b = HMAC.getHmac(baseString, consumerSecret + '' +
tokenSecret);
//  //
//  return Base64Encoder.encode(b);
String ret = null;
try {
ret = hmacsha1(baseString, consumerSecret + '' + 
tokenSecret);
} catch (Exception e) {
new RuntimeException(e.getMessage());
}
return ret;
}


private static String hmacsha1(String key, String message)
throws CryptoTokenException, CryptoUnsupportedOperationException,
IOException {
  HMACKey k = new HMACKey(key.getBytes());
  HMAC hmac = new HMAC(k, new SHA1Digest());
  hmac.update(message.getBytes());
  byte[] mac = hmac.getMAC();
  return Base64OutputStream.encodeAsString(mac, 0,
mac.length, false, false);
}

and any  base 64 encodings with Base64OutputStream.encodeAsString(mac,
0, mac.length, false, false);

I get 401 errors when attempting to get my request token.

I can replace my secrets, ids and pass with dummys and place a step by
steps of what is going on if that would help?