Android Open Source - android-udoo-rover Helpers






From Project

Back to project page android-udoo-rover.

License

The source code is released under:

Copyright (c) 2014, Emanuele Palazzetti and contributors All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the followin...

If you think the Android project android-udoo-rover listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package me.palazzetti.adkrover.utils;
//from w  w  w  . j a  va2 s .com
import android.util.Base64;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Some class helpers
 */

public class Helpers {
    public static boolean isInteger(String s) {
        try {
            Integer.parseInt(s);
        } catch(NumberFormatException e) {
            return false;
        }
        return true;
    }

    public static JSONObject createMockTweet(String text) throws JSONException{
        return new JSONObject().put("id", "240859602684612608").put("text", text);
    }

    public static String oAuth2TwitterEncoding(String consumerKey, String consumerSecret) {
        String combinedKey = consumerKey + ":" + consumerSecret;

        return Base64.encodeToString(combinedKey.getBytes(), Base64.NO_WRAP);
    }
}




Java Source Code List

me.palazzetti.adkrover.RoverActivity.java
me.palazzetti.adkrover.arduino.Arduino.java
me.palazzetti.adkrover.twitter.MalformedTwitterCommand.java
me.palazzetti.adkrover.twitter.TwitterParser.java
me.palazzetti.adkrover.twitter.TwitterReceiver.java
me.palazzetti.adkrover.utils.Helpers.java
me.palazzetti.adkrover.utils.UrlConnector.java