Android Open Source - OMGDrums O M G Helper






From Project

Back to project page OMGDrums.

License

The source code is released under:

The OMG License This license is not enforcable.

If you think the Android project OMGDrums listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.monadpad.omgdrums;
//from  w  w  w . j a  v a 2  s . c o m
import android.content.ContentValues;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

/**
 * User: m
 * Date: 11/20/13
 * Time: 11:51 PM
 */
public class OMGHelper {

    private static String mSubmitUrl = "omg";
    //private static String mHomeUrl = "http://www.openmusicgallery.com";
    //private static String mHomeUrl = "http://10.0.2.2:8888/";
    private static String mHomeUrl = "http://openmusicgallery.appspot.com/";

    private Context mContext;

    private Type mType;
    private String mData;

    public enum Type {
        DRUMBEAT
    }

    public OMGHelper(Context context, Type type, String data) {
        mContext =  context;
        mType = type;
        mData = data;

    }

    public void submitWithTags(String tags, boolean upload) {

        ContentValues data = new ContentValues();
        data.put("tags", tags);
        data.put("data", mData);
        data.put("time", System.currentTimeMillis()/1000);

        SQLiteDatabase db = new SavedDataOpenHelper(mContext).getWritableDatabase();
        db.insert("saves", null, data);
        db.close();

        if (upload)
            new SaveToOMG().execute(mHomeUrl + mSubmitUrl, mType.toString(), tags, mData);

    }

}




Java Source Code List

com.monadpad.omgdrums.AnimatorHelper.java
com.monadpad.omgdrums.DrumMachineView.java
com.monadpad.omgdrums.GetDrawMusicActivity.java
com.monadpad.omgdrums.GetSketchaTuneActivity.java
com.monadpad.omgdrums.HeadBob.java
com.monadpad.omgdrums.Libeniz.java
com.monadpad.omgdrums.Main.java
com.monadpad.omgdrums.MonadJam.java
com.monadpad.omgdrums.OMGHelper.java
com.monadpad.omgdrums.SaveToOMG.java
com.monadpad.omgdrums.SavedDataAdapter.java
com.monadpad.omgdrums.SavedDataOpenHelper.java
com.monadpad.omgdrums.SavedListActivity.java