This file contains hidden or 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
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="jp.hoge" | |
android:versionCode="1" | |
android:versionName="1.0" > | |
<application | |
android:name=".AppImpl_" | |
android:allowBackup="true" | |
android:icon="@drawable/icon" | |
android:label="@string/app_name" | |
android:theme="@style/AppTheme" > |
This file contains hidden or 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
@EFragment(R.layout.fragment_timeline) | |
public class TimelineFragment extends Fragment { | |
@ViewById ListView timelineListView; | |
@AfterViews | |
void onAfterViews(){ | |
List<TimelineItem> items = Lists.newArrayList(); | |
//itemsにデータ詰める | |
TimelineAdapter adapter = new TimelineAdapter(getActivity(), items); | |
timelineListView.setAdapter(adapter); |
This file contains hidden or 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
@SharedPref(value=Scope.UNIQUE) | |
public interface MyPrefs { | |
@DefaultLong(-1) long userId(); | |
} |
This file contains hidden or 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
public class MainActivity extends Activity { | |
// 省略 | |
@Background | |
void login(String username, String password) { | |
try { | |
webApi.login(username, password); | |
callbackLogin(); | |
} catch (HttpClientErrorException e) { | |
callbackLoginMiss(e); |
This file contains hidden or 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
@EActivity | |
public class HogeActivity{ | |
@Rest WebApi webApi; | |
public void hoge(){ | |
try{ | |
UserJson json = webApi.getUser(1234); | |
return json; | |
}catch(RestClientException e){ | |
//HTTPエラー処理 | |
//RestClientException は非チェック例外 |
This file contains hidden or 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
package com.example.contentprovidersample; | |
import android.app.Activity; | |
import android.database.Cursor; | |
import android.os.Bundle; | |
import android.provider.MediaStore; | |
import android.util.Log; | |
import android.view.Menu; | |
public class MainActivity extends Activity { |
This file contains hidden or 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
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:orientation="vertical" | |
tools:context=".MainActivity" > | |
<ListView | |
android:id="@+id/musicList" | |
android:layout_width="match_parent" |
This file contains hidden or 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
echo "start adb shell capture" | |
DATE=$(date +%Y%m%d%H%M%S) | |
FILENAME=${DATE}.mp4 | |
DROPBOX_ID=462856 | |
adb shell screenrecord --verbose --time-limit 5 --size 540x960 /sdcard/demo.mp4 | |
adb pull /sdcard/demo.mp4 ~/Dropbox/Public/capture/${FILENAME} | |
adb shell rm /sdcard/temp.png | |
DROPBOX_URL=https://dl.dropboxusercontent.com/u/${DROPBOX_ID}/capture/${FILENAME} |
This file contains hidden or 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
echo "start adb shell capture" | |
DATE=$(date +%Y%m%d%H%M%S) | |
FILENAME=${DATE}.png | |
DROPBOX_ID=462856 | |
adb shell screencap -p /sdcard/temp.png | |
adb pull /sdcard/temp.png ~/Dropbox/Public/capture/${FILENAME} | |
adb shell rm /sdcard/temp.png | |
DROPBOX_URL=https://dl.dropboxusercontent.com/u/${DROPBOX_ID}/capture/${FILENAME} |
This file contains hidden or 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
package com.example.dhw; | |
import android.content.Context; | |
import android.database.sqlite.SQLiteDatabase; | |
import android.database.sqlite.SQLiteDatabase.CursorFactory; | |
import android.database.sqlite.SQLiteOpenHelper; | |
public class DBHelper extends SQLiteOpenHelper { | |
public DBHelper(Context context, String name, CursorFactory factory, int version) { |