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
//inner build.gradle | |
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:0.9.+' | |
} | |
} | |
apply plugin: 'android' |
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 insertPhoto(LetCursor c) { | |
String assetUUID = getUuid(URI_ASSETS, c.getString(DB.KEY_ASSET_ID)); | |
String inspectionUUID = getUuid(URI_INSPECTIONS, c.getString(DB.KEY_INSPECTION_ID)); | |
String spaceUUID = getUuid(URI_SPACES, c.getString(DB.KEY_SPACE_ID)); | |
String itemUUID = getUuid(URI_ITEMS, c.getString(DB.KEY_ITEM_ID)); | |
String certificateUUID = getUuid(URI_CERTIFICATES, c.getString(DB.KEY_CERTIFICATE_ID)); | |
String meterUUID = getUuid(URI_METERS, c.getString(DB.KEY_METER_ID)); | |
String keyUUID = getUuid(URI_KEYS, c.getString(DB.KEY_KEY_ID)); | |
ContentValues ccv = new ContentValues(); |
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
#<Packet:0xb32426e8> { | |
:id => 12469676, | |
:command_type => "UPLOAD", | |
:client_command_id => "f88f81b1-3b04-47be-8b55-5e9e71b0c2b2", | |
:device_id => "a13c973d60314bdb", | |
:email => "andrew+3@grio.com", | |
:asset_id => "0c860170-a5dd-46fd-b630-3a19314495dd", | |
:inspection_id => "fddd31b2-7818-40fd-a3fc-674f1e18897f", | |
:space_id => nil, | |
:item_id => nil, |
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
<?xml version="1.0" encoding="utf-8"?> | |
<RelativeLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" > | |
<TextView | |
android:id="@+id/tvName" | |
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
private TemplateResponse.Template createOfflineTemplate(String inspectionId) { | |
TemplateResponse.Template template = new TemplateResponse.Template(); | |
template.name = "offline reinspect"; | |
template.status = "300"; | |
ArrayList<TemplateResponse.Space> tempSpaces = new ArrayList<TemplateResponse.Space>(); | |
// Populate Spaces | |
Cursor spaceCursor = getContentResolver().query( |
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
protected boolean addInputToCV(ContentValues cv, String key, TextView inputView, | |
ContentValues baselineCv) { | |
String input = inputView.getText().toString(); | |
if (TextUtils.isEmpty(input) && inputView.getHint() != null) | |
input = inputView.getHint().toString(); | |
// TODO: All this logic is pretty tricky for correctly handling changes in all cases | |
// NB: need to check Button first as Button are also TextViews | |
if (inputView instanceof Button) { // It's a date picker | |
try { |
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 createBookz(@Body String author, | |
String categories, | |
String title, | |
String publisher, | |
Callback<Book> cb); | |
04-16 20:47:53.227 8340-8367/mike.libraryplus.app W/dalvikvm﹕ threadid=11: thread exiting with uncaught exception (group=0x41a5e700) | |
04-16 20:47:53.266 8340-8367/mike.libraryplus.app E/AndroidRuntime﹕ FATAL EXCEPTION: Retrofit-Idle |
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 |
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
@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) { |