background preloader

Android

Facebook Twitter

[TUT] Sending a Tweet | Blundell. Package com.blundell.tut.ttt; import twitter4j.Twitter; import twitter4j.TwitterException; import twitter4j.TwitterFactory; import twitter4j.auth.AccessToken; import twitter4j.auth.RequestToken; import android.app.Activity; import android.content.Intent; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; import android.net.Uri; import android.os.Bundle; import android.util.Log; import android.view.View; import android.webkit.WebView; import android.widget.Button; import android.widget.Toast; public class TweetToTwitterActivity extends Activity { private static final String TAG = "Blundell.TweetToTwitterActivity"; /** Name to store the users access token */ private static final String PREF_ACCESS_TOKEN = "accessToken"; /** Name to store the users access token secret */ private static final String PREF_ACCESS_TOKEN_SECRET = "accessTokenSecret"; private static final String CONSUMER_KEY = "yourConsumerKey"; private static final String CONSUMER_SECRET = "yourConsumerSecret";

Code Examples. Use Gson to work with JSON in your Android apps. In this Android tutorial, William J. Francis uses Gson to build up a standard Java entity and flatten it into JSON. I know... Gson, JSON -- it sounds like a bad tongue twister. But if you've been involved in mobile apps that communicate with a server you've no doubt had a run-in with JSON. For the sake of any readers who aren't familiar with JavaScript Object Notation, Wikipedia defines JSON as follows: "JSON, or JavaScript Object Notation is a lightweight text-based open standard designed for human-readable data interchange. I find myself converting objects to JSON and back again on a regular basis.

There are a number of JSON libraries available for Java and specifically Android. The following tutorial goes through the process of building up a standard Java entity and then flattening it into JSON. 1. 2. 3. 4. 5. 6. Main.xml <LinearLayout xmlns:android=" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center" Launching the Browser From Your Android Applications – The Easy Way. This quick tip shows you how to launch the built-in Browser application in three ways. First, you learn how to launch the browser to a specific URL. Second, you learn how to create text with links.

Third, you learn how to launch a Google web search and specify the search criteria. You will achieve these goals by creating and configuring the appropriate Intents within your application’s Activity class. Step 1: Create an Android Application Begin by creating an Android project. You can follow along with our project: HelloWorldWideWeb, which is available as open source. Step 2: Working with URIs Android uses Uri (Uniform Resource Identifier) objects to identify the unique location of a piece of data.

Uri uriUrl = Uri.parse(" Step 3: Creating the Intent You can view HTML content using the following Intent: android.content.Intent.ACTION_VIEW. Intent launchBrowser = new Intent(Intent.ACTION_VIEW, uriUrl); Step 4: Launching the Intent startActivity(launchBrowser); Android Custom ListView with Image and Text. Android Development Tutorial. Eclipse Color Themes. Building Your First App. SDK. Before installing Android Studio or the standalone SDK tools, you must agree to the following terms and conditions.

This is the Android Software Development Kit License Agreement 1. Introduction 1.1 The Android Software Development Kit (referred to in this License Agreement as the "SDK" and specifically including the Android system files, packaged APIs, and Google APIs add-ons) is licensed to you subject to the terms of this License Agreement. 2. Accepting this License Agreement 2.1 In order to use the SDK, you must first agree to this License Agreement. 3. 3.1 Subject to the terms of this License Agreement, Google grants you a limited, worldwide, royalty-free, non-assignable, non-exclusive, and non-sublicensable license to use the SDK solely to develop applications for compatible implementations of Android. 3.2 You may not use this SDK to develop applications for other platforms (including non-compatible implementations of Android) or to develop another SDK. 4. 5. 6. 7. 8. 9. 12. 13. 14.

Play. The founder and CEO of Onnit, the mega lifestyle brand and one of the fastest growing companies in the country, teaches us how one single day of positive choices leads to a lifetime of concrete strategies for better living, optimal performance, and a stronger mind, body, and spirit. Human optimization thought leader Aubrey Marcus’s personal and professional mission rests on a single question: How can we get the most out of our body and mind on a daily basis? Marcus answers that question in Own the Day, Own Your Life an empowering handbook that guides readers to optimize every moment of the day, from waking in the morning, through work and play, until bedtime each night.

With small, actionable changes implemented throughout the course of one day, we can feel better, perform more efficiently, and live happier. And these daily habits turn into weekly routines, ultimately becoming part of lifelong healthy choices. Samples. Welcome to code samples for Android developers. Here you can browse sample code and learn how to build different components for your applications. Use the categories on the left to browse the available samples. Each sample is a fully functioning Android app. You can browse the resources, source files and see the overall project structure. You can copy and paste the code you need, and if you want to share a link to a specific line you can double-click it to the get the URL. Import Samples from GitHub Android Studio provides easy access to import Android code samples from GitHub and is the recommended method to retrieve Android code samples.

To import a code sample into Android Studio: In the Android Studio menu, select File > Import Sample to open the Import Sample wizard. Note: When starting Android Studio, you can also select Import an Android code sample in the Welcome to Android Studio wizard to import a sample project from GitHub as a new project. Download Samples. Building Your First App.