Skip to content

Instantly share code, notes, and snippets.

View ueno-yuhei's full-sized avatar

ueno ueno-yuhei

  • logiclogic
  • 東京 渋谷
View GitHub Profile
@ueno-yuhei
ueno-yuhei / Bluetooth ON OFF
Last active August 29, 2015 14:01
Bluetooth ON OFF 切り替え
public static class BluetoothChanger{
/**
* Bluetooth ON OFF
*/
public static void setState(Context context,Boolean buletoothState){
BluetoothAdapter mBtAdapter = BluetoothAdapter.getDefaultAdapter();
if( !(mBtAdapter == null) ){
if (buletoothState == true){
mBtAdapter.enable();
} else {
@ueno-yuhei
ueno-yuhei / Bluetooth ListView
Last active August 29, 2015 14:01
Bluetooth 一覧
import android.app.Activity;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
@ueno-yuhei
ueno-yuhei / Buletooth PaireListView.java
Last active August 29, 2015 14:01
Bluetooth ペアリング一覧
import java.util.Set;
import android.app.Activity;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;
public class MainActivity extends Activity {
@ueno-yuhei
ueno-yuhei / Bluetooth discaverable.java
Last active August 29, 2015 14:01
Bluetooth 他の端末から検出可能にする
import android.app.Activity;
import android.bluetooth.BluetoothAdapter;
import android.content.Intent;
import android.os.Bundle;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@ueno-yuhei
ueno-yuhei / Android SQLiteTest.java
Last active August 29, 2015 14:01
Table生成 csv作成 Gmail添付
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import android.app.Activity;
import android.content.Context;
@ueno-yuhei
ueno-yuhei / Holo Graph Sample.java
Last active August 29, 2015 14:01
Holo Graph libraryを使用したグラフ作成
// https://bitbucket.org/danielnadeau/holographlibrary/wiki/Home をimportして使う
// http://dev.classmethod.jp/smartphone/android/android-tips-holographlibrary/ 参考
import android.app.Activity;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.graphics.Color;
import android.os.Bundle;
@ueno-yuhei
ueno-yuhei / aCharteEngin GraphView.java
Last active January 13, 2022 08:59
aChartEngineを使用したグラフ
// https://code.google.com/p/achartengine/ を使用したグラフ
// http://niche-na-blog.seesaa.net/article/393534481.html 参考
// これかなりいい!!!
import org.achartengine.ChartFactory;
import org.achartengine.GraphicalView;
import org.achartengine.chart.PointStyle;
import org.achartengine.model.XYMultipleSeriesDataset;
import org.achartengine.model.XYSeries;
import org.achartengine.renderer.XYMultipleSeriesRenderer;
import android.app.Activity;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
@ueno-yuhei
ueno-yuhei / Spinner.java
Created May 30, 2014 15:52
Spinner生成
import java.util.HashMap;
import java.util.Map;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Spinner;
import java.util.HashMap;
import java.util.Map;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Spinner;