Showing posts with label android. Show all posts
Showing posts with label android. Show all posts

Thursday, December 3, 2015

android rotating image based on Uri / File

Wednesday, November 25, 2015

dbflow raw query

As example:

class Abc {
public static String get_latest_updated_at(Class model, String where, Object... args) {
    ColumnAlias[] alias = new ColumnAlias[1];
    alias[0] = ColumnAlias.columnRaw("max(updated_at) as updated_at");

    String query = "select max(updated_at) as updated_at from "+FlowManager.getTableName(model);

    Cursor cursor = FlowManager.getDatabaseForTable(model).getWritableDatabase().rawQuery(query, null);
    if(cursor.getCount() > 1)
        return "";
    cursor.moveToFirst();
    return cursor.getString(cursor.getColumnIndex("updated_at"));
}


}

calling example:
Abc.get_latest_updated_at(Address.class, "")

//where by Address is model extending BaseModel

Friday, August 28, 2015

installing volley for android

Latest volley is available in maven repository,
therefore, you do not need to compile volley from source code.
goto Build > Library and dependencies > dependencies
click + add, search for volley
com.mcxiaoke.volley:library-aar:1.0.1


If you insists:
---old stuff---
Follow instruction here:
http://www.androidhive.info/2014/05/android-working-with-volley-library-1/

but first, makesure you have setup your environment and paths:

PATH=$PATH:/path-to-android-sdks/platform-tools:/path-to-android-sdks/tools:"/Applications/Android Studio.app/Contents/gradle/gradle-2.4/bin"

export ANDROID_HOME=/path-to-android-sdks

(Please change the path-to-android-sdks and gradle version accordingly)

for windows, you may use SET instead of export.
example: set PATH=%PATH%;...

And,

instead of using ant to build, use `gradle build`.
didnt work for me, i tried to use android studio to open the project, and did not manage to get it compiled...