Android Open Source - test-android-api-sqlite Classes Db Helper






From Project

Back to project page test-android-api-sqlite.

License

The source code is released under:

GNU General Public License

If you think the Android project test-android-api-sqlite 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

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.provider.BaseColumns;
/*from   w w  w. java2  s  . c o  m*/
import java.util.List;

import retrofit.RestAdapter;
import retrofit.http.GET;
import retrofit.http.Headers;
import retrofit.http.Path;

/**
 * Created by Vinay on 12/22/2014.
 */
public interface ClassesService {
    // Returns a list of available terms
    @Headers("Authorization: Bearer 727b3dfb27e3632f09353370b420e")
    @GET("/Terms")
    List<TermResponse> terms();

    // Returns a list of available schools
    @Headers("Authorization: Bearer 727b3dfb27e3632f09353370b420e")
    @GET("/Terms/{TermCode}/Schools")
    List<School> schools(@Path("TermCode") long TermCode);

    // Returns a list of subjects within the chosen school
    @Headers("Authorization: Bearer 727b3dfb27e3632f09353370b420e")
    @GET("/Terms/{TermCode}/Schools/{SchoolCode}/Subjects")
    List<Subjects> schools(@Path("TermCode") long TermCode, @Path("SchoolCode") String SchoolCode);

    // Returns a list of class numbers within the chosen subject
    @Headers("Authorization: Bearer 727b3dfb27e3632f09353370b420e")
    @GET("/Terms/{TermCode}/Schools/{SchoolCode}/Subjects/{SubjectCode}/CatalogNbrs")
    List<CatalogNumbers> schools(@Path("TermCode") long TermCode, @Path("SchoolCode") String SchoolCode,
                             @Path("SubjectCode") String SubjectCode);

    // Returns a list of class section details within the chosen class
    @Headers("Authorization: Bearer 727b3dfb27e3632f09353370b420e")
    @GET("/Terms/{TermCode}/Schools/{SchoolCode}/Subjects/{SubjectCode}/CatalogNbrs/{CatalogNumber}/Sections")
    List<ClassSections> schools(@Path("TermCode") long TermCode, @Path("SchoolCode") String SchoolCode,
                             @Path("SubjectCode") String SubjectCode,
                             @Path("CatalogNumber") long CatalogNumber);
}

public class TermResponse {
    private TermsResponse getSOCTermsResponse;
}

public class TermsResponse {
    String schemaLocation;
    Term term;
}

public class Term {
    public long TermCode;
    public String TermDescr;
    public String TermShortDescr;
}

RestAdapter restAdapter = new RestAdapter.Builder()
        .setEndpoint("http://api-gw.it.umich.edu/Curriculum/SOC/v1")
        .build();

ClassesService service = restAdapter.create(ClassesService.class);

List<Terms> terms = service.terms();




Java Source Code List

.ClassesDbHelper.java
com.android.demo.notepad1.BuildConfig.java
com.android.demo.notepad1.Notepadv1.java
com.android.demo.notepad1.NotesDbAdapter.java
com.vhiremath.testapiwithsqlite.ApplicationTest.java
com.vhiremath.testapiwithsqlite.MainActivity.java