Updates from November, 2007 Toggle Comment Threads | Keyboard Shortcuts

  • steve918 2:11 am on November 28, 2007 Permalink | Reply  

    Android: Simple Tabs Example 

    It seems google may have shipped android with a tab widget that is said to be deprecated from the time of release.

    Here is a simple method I’ve used to implement tab-like functionality that seems to work well for me. You can easily change the background of the buttons to look just like tabs, but I kept the example as clean and simple as possible.

    Tabs Screen Shot

    • ameya 10:53 pm on March 26, 2009 Permalink | Reply

      Hi , there , good tutorial , do u know how to customize a button , with image.

  • steve918 4:30 pm on November 27, 2007 Permalink | Reply  

    Accessing Android Resources By Name at Runtime 

    Use the getIdentifier method passing it the name of your resource, the resource type (id, raw) and your package name ( just use getPackageName())

    int id = getResources().getIdentifier("name_of_resource", "id", getPackageName());

    After that you can use the id just like you would at compile time using the R class.

    Updated: May 21, 2010 – The code that was here for a long time was awful and dated, so I’ve updated this post.

    • eisernWolf 6:37 am on March 31, 2009 Permalink | Reply

      See Resources.getIdentifier. For example: http://www.anddev.org/viewtopic.php?p=17846

    • steven 7:03 am on March 31, 2009 Permalink | Reply

      Ah, absolutely. This post is _very_ dated and I not recommend using my code example to anyone.

    • carlos 3:19 am on September 28, 2009 Permalink | Reply

      but with the example http://www.anddev.org/viewtopic.php?p=17846, we can’t get a button id for example. Steven, it could be possible with your code example, but is it recommendable? please, help me with this little trouble. (you can send me a mail)

      • steven 10:01 am on October 3, 2009 Permalink | Reply

        This code is really dated, I know there is a much cleaner way to do this now, but unfortunately I haven’t kept up with my Android development and can’t be to much help.

    • Tim H 4:55 pm on October 16, 2009 Permalink | Reply


      You want this:
      Log.i(TAG, “Found Button ID: ” + getResources().getIdentifier(“Button01”, “id”, “com.android.test”));
      Log.i(TAG, “Found Button ID: ” + getResources().getIdentifier(“com.android.test:id/Button01”));

      The code mentioned shows how to get a drawable, just replace drawable for another type in the resource file (id, drawable, layout, string, etc)

    • keckia 7:37 pm on March 1, 2010 Permalink | Reply

      thanx, thats what I needed 😀

    • Janusz Leidgens 8:56 am on June 30, 2010 Permalink | Reply

      thanks the documentation sadly lacks an example

    • Christopher 10:13 am on October 12, 2010 Permalink | Reply

      Thank you so much for your help Steve! 🙂
      You are my hero of the day 🙂

    • Murat 5:38 pm on April 21, 2012 Permalink | Reply

      Thank you so much Steve !!! That is great example..

  • steve918 2:17 pm on November 25, 2007 Permalink | Reply  

    Google Hax0rs 

    I noticed this interesting entry in my server’s access log today. I certainly have phpMyAdmin running at that location, but you can’t get the process list unless you login. xxxxxxxxx.com – [21/Nov/2007:13:43:18 -0800] “GET /MyAdmin/server_processlist.php?lang=en-utf-8&convcharset=iso-8859-1&collation_connection=utf8_unicode_ci&token=a1bb5490499a10bb493edc160625e33b&kill=49481 HTTP/1.1” 404 345 “-” “Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)”

    You can do two things at that screen:

    1. See what processes MySQL is running
    2. Stop a MySQL process

    Neither of witch is something I would expect Google to be interested in on my personal webserver.

  • steve918 3:53 pm on November 21, 2007 Permalink | Reply  

    Android Iconified List 

    Iconified List
    I’ve had a lot of fun hacking on Android applications recently and I’m really looking forward to seeing the future of Android unfold. My first project was the the password safe I mentioned in my last post and while working on some features for it I was looking for an example of a composite view that allowed you have cute little icons next to each entry in a list, I found a few examples that did similar things, but nothing was quite what I was looking for so I threw together the view you see here last night. I’m sure someone is else is looking to do something similar so I thought I would post about it and make it available to everyone.

    Most of the magic happens by in the BulletedText View class. I basically just extend LinearLayout and create a composite view that contains an ImageView and TextView object: (Sorry if the code is a little cramped, I need to figure out how to keep wordpress from eating blank lines)

    public class BulletedTextView extends LinearLayout {
        private TextView mText;
        private ImageView mBullet;
        public BulletedTextView(Context context, String text, Drawable bullet) {
                mBullet = new ImageView(context);
                // left, top, right, bottom
                mBullet.setPadding(0, 2, 5, 0);
                addView(mBullet,  new LinearLayout.LayoutParams(
                     LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
                mText = new TextView(context);
                addView(mText, new LinearLayout.LayoutParams(
                     LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
        public void setText(String words) {
        public void setBullet(Drawable bullet) {

    Then I created a custom list adapter for my view.
    (More …)

    • VataMyday 8:35 pm on May 22, 2009 Permalink | Reply

      any changes coming ?

    • steven 10:52 pm on May 28, 2009 Permalink | Reply

      VataMyday, I’m afraid not. I haven’t had much interest lately in Android development and haven’t put much thought into it.

    • Michael 3:58 am on July 13, 2010 Permalink | Reply

      Great tutorial!
      In the checkbox class (the runner class), I set it to put the list in a tab. I need to see the status of each checkbox in another class, however I cant make a new instance of “Checkbox” otherwise all the values would return false because it would run the oncreate method for that instance of “Checkbox”. How can I see the status of the individual checkboxes that are in the tab from another class? thanks!

  • steve918 1:16 am on November 20, 2007 Permalink | Reply
    Tags: , , ,   

    Android Password Safe 

    I’ve got my first working Android application together. It’s just a simple password safe with some decent features for a first release including:

    • 128 Bit AES Encryption
    • Password protected. Your password is needed to decrypt the data stored in the safe
    • All data is entrypted including notes, website link, description
    • Click through website link, will take you from your entry to the website.

    Here are a couple of screen shots to give you an idea of what the application looks like (Click to enlarge)

    Password Edit

    Login Screen

    Password List


    Plans for future versions include:

    • Fetching/Caching of favicons
    • Customizable encryption. Maybe 256bit AES, DES, etc.

    You can always download it and check it out for yourself. Let me know what you think and if you find any bugs or have ideas for improvements.

    • Mfer 2:21 am on July 30, 2009 Permalink | Reply

      Hi Steve. Great application. Maybe in the future can sync with another desktop application (1 password or keepassx). Congratulations.

    • Mark 8:51 pm on August 19, 2009 Permalink | Reply

      Hi Steve,
      I was thinking about upgrading to an Android phone but couldn’t find a password app in the store so this is great.
      One enhancement I would love would be to able to sync with a desktop app so secrets could be edited and accessed from both my phone and desktop.
      Thanks again.

    • Graeme 12:06 pm on October 3, 2009 Permalink | Reply

      Hi Steve I would also like an application that can sync with a desktop application as well, also a search function would be good as this is used a lot in my existing password store.

    • steven 10:24 pm on October 6, 2009 Permalink | Reply

      @Graeme this project is now part of OpenIntents and is not maintained by me. Check out http://www.openintents.org/en/node/205 I recommend filing a feature request with them.

  • steve918 6:49 pm on November 15, 2007 Permalink | Reply  

    Yay, I'm a Anti-Phising Champion 

    I got an invitation to take the Paypal Anti-Phishing challenge. It’s all of 5 questions long, but it’s a neat way to educate user’s about phising.


  • steve918 4:24 pm on November 15, 2007 Permalink | Reply  

    Internet Identity Workshop 

    I have the privilege of attending this years Internet Identity Workshop in Mountain View. I’ll be hanging out there Dec 3-5. I’ll try to get some pics and things to post on my blog along with an overview of the event.

    IIW2007 Registration banner


Compose new post
Next post/Next comment
Previous post/Previous comment
Show/Hide comments
Go to top
Go to login
Show/Hide help
shift + esc