Skip to content

Instantly share code, notes, and snippets.

View amay077's full-sized avatar
🏠
Working from home

amay077 amay077

🏠
Working from home
View GitHub Profile
@amay077
amay077 / MainActivity.cs
Created March 26, 2013 14:51
Xamarin Component Store を眺めてみる ref: http://qiita.com/items/811cdd8ab3d1243045b6
<省略>
using Xamarin.Controls;
namespace AlertCenterSample
{
[Activity (Label = "AlertCenterSample", MainLauncher = true)]
public class Activity1 : Activity
{
protected override void OnCreate(Bundle bundle)
{
@amay077
amay077 / TimeoutableLocationListener.java
Created January 13, 2011 12:27
[Android]TimeoutableLocationListner: TimeoutableLocationListner is implementation of LocationListener for Android. If onLocationChanged isn't called within XX mili seconds, automatically remove.
package com.amay077.android.location;
import java.util.Timer;
import java.util.TimerTask;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
@amay077
amay077 / _config.yml
Created March 31, 2013 07:42
Octopress Top Categories Plugin を使う ref: http://qiita.com/items/3296fdf1ea11c7c9ace4
# [変更]custom/asides/top_category_list.html を任意の位置に挿入する
default_asides: [custom/asides/about.html, asides/recent_posts.html, custom/asides/top_category_list.html]
# [追加]カテゴリの表示件数
top_category_limit: 15
@amay077
amay077 / file0.sh
Created April 10, 2013 09:32
SharedPreference は消さずにアプリだけアンインストールする方法 ref: http://qiita.com/items/5442b2e9b8673922a13e
adb shell pm uninstall -k <package name>
@amay077
amay077 / DateTimeFormatTest.java
Created April 15, 2013 10:33
DateFormat.format では HH:mm が使えない ref: http://qiita.com/items/b33603b958a4d0eedc8a
long t = System.currentTimeMillis();
Log.d("By DateFormat", DateFormat.format("HH:mm", t).toString());
Log.d("By SimpleDateFormat", new SimpleDateFormat("HH:mm").format(new Date(t)));
@amay077
amay077 / Metadata.xml
Created May 25, 2013 14:54
Xamarin.Android で Fused Location Provider(など)を使う ref: http://qiita.com/items/550859347e84a0410d75
<metadata>
<remove-node path="/api/package[@name='com.google.android.gms.maps']/class[@name='GoogleMapOptionsCreator']" />
<remove-node path="/api/package[@name!='com.google.android.gms.maps'
and @name != 'com.google.android.gms.maps.model'
and @name != 'com.google.android.gms.common'
and @name != 'com.google.android.gms.location']" />
<remove-node path="/api/package[@name='com.google.android.gms.maps.model']/class[contains (@name, 'Creator')]" />
<remove-node path="/api/package[@name='com.google.android.gms.location']/class[contains (@name, 'Creator')]" />
<attr path="/api/package[@name='com.google.android.gms.maps']" name="managedName">Android.Gms.Maps</attr>
@amay077
amay077 / file0.sh
Created June 13, 2013 11:57
WakeLock の状態を確認する ref: http://qiita.com/items/1ebc77d2f57414532976
adb shell dumpsys power
// Tap gesture
this.View.AddGestureRecognizer(new UITapGestureRecognizer(tap =>
{
Debug.WriteLine("Double Tap.");
})
{
NumberOfTapsRequired = 2 // Double tap
});
// Drag(Pan) gesture
@amay077
amay077 / PullUpToCloseSampleViewController.cs
Created July 28, 2013 02:09
Pull up to Close を実装してみる、Xamarin.iOS で ref: http://qiita.com/amay077/items/9418e010475b08d7ab8b
public partial class PullUpToCloseSampleViewController : UIViewController
{
public PullUpToCloseSampleViewController() : base ("PullUpToCloseSampleViewController", null)
{
}
public override void ViewDidLoad()
{
base.ViewDidLoad();
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import android.content.Context;
import android.os.Environment;
import android.test.InstrumentationTestCase;
import android.util.Log;