Football Fans: Download the 2012 Schedule App from Google Play!


Go Back   Android Forums > Android Development > Application Development > Alpha & Beta Testing

Alpha & Beta Testing Developers can post their .apk and ask users to recreate bugs for them, etc, for testing purposes.



Reply
 
LinkBack Thread Tools
Old July 25th, 2011, 01:03 AM   #1 (permalink)
New Member
 
Join Date: Jul 2011
Posts: 6
 
Device(s): Samsung Galaxy S
Thanks: 2
Thanked 1 Time in 1 Post
Default [Testers needed]: Runner's app

Hi guys,

I am new to Android development and made a simple application for runners. As a simple description, it is an application to calculate for one's average pace given his time and distance in a race. Simple as that. Although I'm planning for additional features in the future such as storing all races in a database.

I am not sure how it would look like on different phones of different sizes. I might have problems in layout.

You may download it here.

I would love to hear comments/suggestions from you guys about my simple work.

Thanks.

Francis

android1112 is offline  
Reply With Quote
Sponsors
Old July 25th, 2011, 10:18 PM   #2 (permalink)
not really so scary
 
scary alien's Avatar
 
Join Date: Mar 2010
Location: Indy
Posts: 8,702
 
Device(s): Samsung Galaxy Nexus, Moto Droid X, Moto Xoom, HTC Droid Eris
Thanks: 6,634
Thanked 4,669 Times in 2,589 Posts
Default

Francis,

Very clean, simple app. Great job!

My days of running for distance are long behind me (I still play a little soccer on the weekends, though ).

Everything worked just fine. Nice interface. Good color choices.

I know this isn't an app to use while you run, but I wonder if there are apps that make use the phone's built-in accelerometer to count paces? Just an idea...

Cheers and good job!
scary alien is offline  
Reply With Quote
The Following User Says Thank You to scary alien For This Useful Post:
android1112 (July 25th, 2011)
Old July 25th, 2011, 10:25 PM   #3 (permalink)
not really so scary
 
scary alien's Avatar
 
Join Date: Mar 2010
Location: Indy
Posts: 8,702
 
Device(s): Samsung Galaxy Nexus, Moto Droid X, Moto Xoom, HTC Droid Eris
Thanks: 6,634
Thanked 4,669 Times in 2,589 Posts
Default

By the way, you could jazz-up your time fields by using a TimePreference.

Its been a while since I've coded one into my app, but I think I started with this web site:

Android Time Picker Preference | Ebessette.com

and I also used some information from here:

Android Preferences | Kaloer.com

Here's the TimePreference.class file that I ended-up with:

Code:
import android.content.Context;
import android.content.res.TypedArray;
import android.preference.DialogPreference;
import android.util.AttributeSet;
import android.view.View;
import android.widget.TimePicker;

public class TimePreference extends DialogPreference {
    private int lastHour = 0;
    private int lastMinute = 0;
    private TimePicker picker = null;

    public static int getHour(String time) {
        String[] pieces=time.split(":");
	    Common.myLog (BattMonXService.LOG_VERBOSE, "TimePreference: getHour() returning: " + pieces[0]);

        return(Integer.parseInt(pieces[0]));
    }

    public static int getMinute(String time) {
        String[] pieces=time.split(":");
	    Common.myLog (BattMonXService.LOG_VERBOSE, "TimePreference: getMinute() returning: " + pieces[1]);

        return(Integer.parseInt(pieces[1]));
    }

    public TimePreference(Context ctxt) {
        this(ctxt, null);
    }

    public TimePreference(Context ctxt, AttributeSet attrs) {
        this(ctxt, attrs, 0);
    }

    public TimePreference(Context ctxt, AttributeSet attrs, int defStyle) {
        super(ctxt, attrs, defStyle);

        setPositiveButtonText("Set");
        setNegativeButtonText("Cancel");
    }

    @Override
    protected View onCreateDialogView() {
        picker=new TimePicker(getContext());

        return(picker);
    }

    @Override
    protected void onBindDialogView(View v) {
        super.onBindDialogView(v);

        picker.setCurrentHour(lastHour);
        picker.setCurrentMinute(lastMinute);
    }

    @Override
    protected void onDialogClosed(boolean positiveResult) {
        super.onDialogClosed(positiveResult);

        if (positiveResult) {
            lastHour  = picker.getCurrentHour();
            lastMinute= picker.getCurrentMinute();
            String time = null;

            if ( lastMinute < 10 )
             time=String.valueOf(lastHour)+":0"+String.valueOf(lastMinute);
            else
             time=String.valueOf(lastHour)+":"+String.valueOf(lastMinute);
            	
            setSummary("Selected time: " + time);
            
            if (callChangeListener(time)) {
                persistString(time);
            }
        }
    }

    @Override
    protected Object onGetDefaultValue(TypedArray a, int index) {
        return(a.getString(index));
    }

    @Override
    protected void onSetInitialValue(boolean restoreValue, Object defaultValue) {
        String time=null;

        if (restoreValue) {
            if (defaultValue==null) {
                time=getPersistedString("00:00");
            }
            else {
                time=getPersistedString(defaultValue.toString());
            }
        }
        else {
            time=defaultValue.toString();
        }

        lastHour=getHour(time);
        lastMinute=getMinute(time);
    }
}
and here is one of the set of entries in my preferences.xml file:

Code:
                  <sa.battmonx.TimePreference
                        android:key="startTimeOne"
                        android:defaultValue="00:00"
                        android:title="Start Time One"
                        android:summary="Select an starting monitoring time" />
                        
                  <sa.battmonx.TimePreference
                        android:key="endTimeOne"
                        android:defaultValue="23:59"
                        android:title="End Time One"
                        android:summary="Select an ending monitoring time" />
Like I said, its been a while since I've coded the above, but I'm sure you'll be able to do something in your app, too, should you decide to.

Cheers and good luck!
scary alien is offline  
Reply With Quote
Old July 25th, 2011, 10:39 PM   #4 (permalink)
New Member
 
Join Date: Jul 2011
Posts: 6
 
Device(s): Samsung Galaxy S
Thanks: 2
Thanked 1 Time in 1 Post
Default

Thanks! I appreciate your comments.

Yes, indeed, this not an app while you run. It is an after-run app.

Good idea about counting paces. I've seen some apps doing that but with the use of GPS(I don't have experience in developing here yet). And you could use that while running.

What I intend to do here in the future is to make it a race/training log. You input your data, pace is computed then stored to a database. If data network is not available, it is stored in phone's database. If data network is available, you can sync it to a website. (Still too much work ahead, though). It will give a runner an overview for his training and races.

If my studying path is correct, I should be learning SQLite to do the database storage on the phone. Am I correct?
android1112 is offline  
Reply With Quote
Old July 25th, 2011, 10:47 PM   #5 (permalink)
not really so scary
 
scary alien's Avatar
 
Join Date: Mar 2010
Location: Indy
Posts: 8,702
 
Device(s): Samsung Galaxy Nexus, Moto Droid X, Moto Xoom, HTC Droid Eris
Thanks: 6,634
Thanked 4,669 Times in 2,589 Posts
Default

No problem -- glad to help and just wanted to throw an idea out there (re. the accellerometer thing) .

Yeah, that sounds right to me re. the SQLite DB path...there's just so much to learn and do, I haven't delved into that area myself yet.

You've taken the most important step, though, just building and app and putting it out there for review.

Cheers and I wish you continued good luck and success!
scary alien is offline  
Reply With Quote
Reply

Bookmarks


Go Back   Android Forums > Android Development > Application Development > Alpha & Beta Testing User CP
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -5. The time now is 04:13 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Custom vBulletin Skins by: Relivo