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
# Path to your oh-my-zsh configuration. | |
ZSH=$HOME/.oh-my-zsh | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. | |
ZSH_THEME="robbyrussell" | |
# Set to this to use case-sensitive completion |
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
function ntf_add($user_id,$body,$model,$action,$data_id) { | |
$this->create(); | |
$record['Notification']['user_id'] = $user_id; //通知させたいユーザー | |
$record['Notification']['body'] = $body; // 通知メッセージ | |
// http://host/model/action/data_id を訪れたときに既読処理を行う | |
$record['Notification']['model'] = $model; | |
$record['Notification']['action'] = $action; | |
$record['Notification']['data_id'] = $data_id; |
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
$this->Notification->ntf_add( | |
$user_id, // 通知させたいユーザー | |
$user.'さんからメッセージが届いています', // 通知メッセージ | |
'offers', // モデル | |
'view', // アクション | |
$offer_id // 数値など | |
); | |
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
// 参考:http://www.adakoda.com/android/000077.html http://techbooster.org/android/ui/9039/ | |
package edu.self.myapp01; | |
import android.app.Activity; | |
import android.os.Bundle; | |
import android.util.Log; | |
import android.view.View; | |
import android.widget.AdapterView; | |
import android.widget.ArrayAdapter; |
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"?> | |
<LinearLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
android:orientation="vertical" | |
android:layout_width="fill_parent" | |
android:layout_height="fill_parent" | |
> | |
<ListView | |
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
// 参考:http://androidguide.nomaki.jp/html/app_r21/appMain.html | |
package edu.self.myapp01; | |
import android.app.Activity; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.widget.ArrayAdapter; | |
import android.widget.Button; | |
import android.widget.EditText; |
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
<!-- 参考:http://androidguide.nomaki.jp/html/app_r21/appMain.html --> | |
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:orientation="vertical" android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:padding="20dp"> | |
<LinearLayout |
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
DriveFile file = file.openContents(mGoogleApiClient, DriveFile.MODE_READ_ONLY, null).addResultCallback(contentsOpenedCallback); | |
ResultCallback<DriveApi.ContentsResult> contentsOpenedCallback = | |
new ResultCallback<DriveApi.ContentsResult>() { | |
@Override | |
public void onResult(DriveApi.ContentsResult result) { | |
if (!result.getStatus().isSuccess()) { | |
// display an error saying file can't be opened | |
return; | |
} |
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[] projection = new String[] { "_id", "name" }; | |
//Uriの作成 | |
Uri calendars = Uri.parse("content://com.android.calendar/calendars"); | |
//クエリ実行 | |
Cursor c = getContentResolver().query(calendars, projection, null, null, null); | |
//値を取得 | |
if (c.moveToFirst()) { | |
String name; | |
String id; |
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 FileHackerDatabaseHelper dbHelper; | |
dbHelper = new FileHackerDatabaseHelper(getContext()); | |
final SQLiteDatabase db = dbHelper.getWritableDatabase(); | |
ContentValues values = new ContentValues(); | |
values.put(TITLE, mTitle); | |
values.put(START, mStart); | |
values.put(END, mEnd); | |
values.put(EVENT_ORIGINAL_ID, mOriginalId); | |
values.put(ALL_DAY, mAllDay); | |
values.put(CALENDAR_ID, mCalendarId); |
OlderNewer