Pages

Saturday, October 15, 2011

Skribblit!

I wrote a new post on http://jmarstudios.com about the new Android application I published to the Android Marketplace... http://jmarstudios.com/2011/10/15/introducing-skribblit/

You can download Skribblit here: https://market.android.com/details?id=com.jmarstudios.skribblit

Enjoy! :)

Friday, October 7, 2011

My New Site! JMaRStudios.com

I have started migrating over to using http://jmarstudios.com I am trying out the WordPress format. So far I'm kinda diggin it ;)

Anyway, that is where I will be posting from now on. Hopefully you will join me :)

Thank you for reading!!!

Wednesday, October 5, 2011

Why Does My ListView Look Different?

It seems to me that the following statement, made by an official Motorola representative, purposefully breaks Android's paradigm of developing an app so that it provides a consistent user experience across all devices.

If you like the gray bottom-of-list background on the Motorola Android 2.3.x devices, and you want your application to blend in with the device rather than look the same across devices, then you’re set. You don’t need to do anything.

The simple fix

But if you (or your client, or users) want the ListView background to display at full screen, or your application to look the same across multiple devices, there’s a simple solution.

How can there be a "simple solution" to wanting what I expect to be the default behavior... looking the same across all devices?

I understand that the manufacturer's are "allowed" to do this. But is that really a good thing? I mean, Motorola actually went out of their way to break the consistent user experience and force it on the developer to do some stupid workaround.

I feel like this fragmentation issue is getting just a tad bit ridiculous...

http://community.developer.motorola.com/t5/MOTODEV-Blog/Why-Does-My-ListView-Look-Different/bc-p/18521

Saturday, October 1, 2011

Using Custom Fonts With Android

I was messing around and figured out how to use custom fonts in your Android application. It's really simple so this will be a quick and dirty how-to...

Custom fonts use the TypeFace class.

First find yourself a nice font... I found and will use this one here called "Cheyenne Hand" at 1001 Free Fonts.

After downloading and unzipping the file, add the ttf font file to your project in the following directory:
assets/fonts/[fontname].ext

Now in your layout file (main.xml in this case) you would create a TextView as you normally would...
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
>
    <TextView
        android:id="@+id/textViewDefault"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Default Font Text..."
        android:layout_alignParentTop="true"
        android:layout_alignParentLeft="true"
        android:textSize="30sp" />
    <TextView
        android:id="@+id/textViewCustom"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Custom Font Text..."
        android:textSize="30sp"
        android:layout_below="@+id/textViewDefault"
        android:layout_alignParentLeft="true"
        android:layout_marginTop="100dp" />
</RelativeLayout>


Now in your activity you create a TypeFace object.
Typeface tf = Typeface.createFromAsset( getAssets(), "fonts/cheyenne_1.ttf" );


Then get the TextView
TextView tv = (TextView)findViewById( R.id.textViewCustom );


Then bind the TypeFace to the TextView
tv.setTypeface( tf );


Now take a look and you will see something like this...



Added source on Google Code: https://code.google.com/p/tutorial-android-custom-font/

Download the apk here: