This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void submitNewUpload(String projectid, final String mediaid, String calloutId) { | |
handleUploadComplete(mediaid); | |
try { | |
JSONObject jsonObject = ServiceUtils.createInsertSubmitRequest(token, projectid, | |
mediaid, calloutId); | |
Log.d(CLASS_NAME, "submitNewUpload Send => " + jsonObject.toString()); | |
String url = Constants.BASE_URL + API_SUBMIT_ENDPOINT; | |
JsonObjectRequest objectRequest = new JsonObjectRequest(Request.Method.POST, url, | |
jsonObject, new Response.Listener<JSONObject>() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void handleUploadComplete(String mediaId) { | |
Intent postUploadSubmit = new Intent(); | |
postUploadSubmit.setAction(Constants.ACTION_MEDIA_ID_RECEIVED); | |
postUploadSubmit.putExtra("upload_id", uploadId); | |
postUploadSubmit.putExtra("media_id", mediaId); | |
sendBroadcast(postUploadSubmit); | |
Log.d(CLASS_NAME, "UPLOAD COMPLETE FOR UPLOAD: " + uploadFile.getFilename()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:id="@+id/container" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context="com.leedir.MainActivity"> | |
<View | |
android:id="@+id/loadingView" | |
android:layout_width="match_parent" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String[] blah = new String[1]; | |
blah[0] =DB.Assets.KEY_REFERENCE_CODE; | |
Cursor cursor = db.query(DB.DB_ASSETS, blah, null, null, null, null, null); | |
if(cursor.moveToFirst()) | |
db.execSQL(String.format(Locale.US,"ALTER TABLE %s ADD COLUMN ADD COLUMN %s", | |
DB.DB_ASSETS, DB.Assets.KEY_REFERENCE_CODE)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
protected void onResume() { | |
super.onResume(); | |
imageView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { | |
@Override | |
public void onGlobalLayout() { | |
loadImageIfReady(); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
//make restAdapter | |
RestAdapter restAdapter = new RestAdapter.Builder() | |
.setEndpoint("http://prolific-interview.herokuapp.com/53444c44ce48cc11ad329ec5") | |
.build(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public boolean onOptionsItemSelected(MenuItem item) { | |
switch (item.getItemId()) { | |
case android.R.id.home: | |
// app icon in action bar clicked; go home | |
this.finish(); | |
return true; | |
case R.id.menu_share: | |
Intent share = new Intent(Intent.ACTION_SEND); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public boolean onCreateOptionsMenu(Menu menu) { | |
getMenuInflater().inflate(R.menu.menu_book_detail, menu); | |
// Get the ActionProvider for later usage | |
provider = (ShareActionProvider) menu.findItem(R.id.menu_share).getActionProvider(); | |
return true; | |
} | |
@Override | |
public boolean onOptionsItemSelected(MenuItem item) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<menu xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
tools:context="mike.libraryplus.app.BookDetailActivty"> | |
<item | |
android:id="@+id/menu_share" | |
android:actionProviderClass="android.widget.ShareActionProvider" | |
android:icon="@drawable/ic_share" | |
android:orderInCategory="100" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@POST("/books") | |
void createBook(@Body Book book, | |
Callback<Book> cb); | |
04-16 20:59:24.782 8697-8697/mike.libraryplus.app E/DEBUG﹕ retrofit.RetrofitError: java.io.EOFException | |
04-16 20:59:33.219 8697-8697/mike.libraryplus.app E/DEBUG﹕ retrofit.RetrofitError: retrofit.converter.ConversionException: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 |