Another Android Blog

Yet another Android developer's blog

Skip to: Content | Sidebar | Footer

Category: Android Development

Passing Toast Message to a New Activity

30 December, 2011 (21:25) | Activity, Messaging | By: Randall Mitchell

Greetings readers. I have implemented a “very basic” messaging system within one of my applications. An example use case is as follows: 1. User arrives at an activity. 2. The activity realizes that the user needs to be in another activity. 3. The activity posts a user message to the application and sends the user [...]

Using Shared Preferences Explained

14 July, 2011 (17:09) | Data Storage | By: Randall Mitchell

This post explains further the example code on the Android Developer site: http://developer.android.com/guide/topics/data/data-storage.html I am trying to dumb this down as best as I can, so some useful options may be left out. Here is the code found on that page as of July 14, 2011: public class Calc extends Activity { public static final [...]

Protecting Your Android Application

8 July, 2011 (15:39) | Android Development, Security | By: Randall Mitchell

I was just thinking to myself, I need to make my published apps more secure. I found this post enlightening and a good start. It’s from the guy that wrote Android Wireless Application Development and covers obfuscation, using the Android License Verification Library, and SSL encryption for connected apps. Good stuff! http://www.informit.com/articles/article.aspx?p=1725260

Button Hit Area for Custom Graphics

1 July, 2011 (14:13) | Components, UI Design | By: Randall Mitchell

I decided to create an “irregularly shaped” and small arrow image to be used as a button. The problem was, when I set it as a background image, the hit area only reported when the actual image was being hit. The quick fix is to use a drawable inset to create a bounding box around [...]

Drop Shadow LinearLayout

29 June, 2011 (09:23) | Components, UI Design | By: Randall Mitchell

I thought I would share this quick tip I just cooked up. To create a drop shadow below a layout component, you can add a “view” of the same width immediately below that component and set the background of that view to a drawable xml file containing a gradient. Here is an example layout file [...]

Calling Activity for Result

9 June, 2011 (14:40) | Activity | By: Randall Mitchell

I was going to write one up but this site did the work as well as I could have: See the tutorial here It’s really a relatively simple problem with a relatively simple solution. Like I prefer to do in my posts, however, the solution has been completely explained. Ps. Nice blog template Sai

Passing Data With an Intent

27 May, 2011 (01:47) | Snippets | By: Randall Mitchell

This is the code to pass data from one activity to another through an Intent. This is the code used to create and pass data into an Intent. String dataToPass = "The next activity needs this sentence."; … Intent intent = new Intent(this, NextActivity.class); intent.putExtras("KeyToAccessData", dataToPass); startActivity(intent); And this is how you catch that data [...]

Custom Composite Android Component

26 May, 2011 (20:58) | Components | By: Randall Mitchell

This example puts a couple of TextViews into a LinearLayout. The combination of components is then treated as one component with the added functionality of programmatically changing the text of the two TextViews.

Launch New Activity

25 May, 2011 (00:04) | Snippets | By: Randall Mitchell

Intent takes two parameters in the most basic example. The first parameter is the class calling the new Activity (Intent). The second parameter is the class name of the Activity to launch. Intent intent = new Intent(this, ActivityClassToLaunch.class); startActivity(intent); Using finish() will close the calling activity. This will keep the user from using the back [...]

RSS XLM Document Parsing/Parser

28 October, 2010 (16:45) | DOM Parsing, RSS | By: Randall Mitchell

I’ve seen a lot of examples for parsing XML using SAX. As far as I can tell, that is the most efficient method for doing so. Honestly though, I’m not really sure how much of a crutch using the DOM would be on speed. I thought, as a learning experience, I would break from this [...]