Download free for 30 days
Sign in
Upload
Language (EN)
Support
Business
Mobile
Social Media
Marketing
Technology
Art & Photos
Career
Design
Education
Presentations & Public Speaking
Government & Nonprofit
Healthcare
Internet
Law
Leadership & Management
Automotive
Engineering
Software
Recruiting & HR
Retail
Sales
Services
Science
Small Business & Entrepreneurship
Food
Environment
Economy & Finance
Data & Analytics
Investor Relations
Sports
Spiritual
News & Politics
Travel
Self Improvement
Real Estate
Entertainment & Humor
Health & Medicine
Devices & Hardware
Lifestyle
Change Language
Language
English
Español
Português
Français
Deutsche
Cancel
Save
EN
Uploaded by
Katsuki Nakatani
PPTX, PDF
10,194 views
AndroidでGeoFenceを使って見る
2014/12/13にGDG京都さんでLTした内容です。 AndroidでGeoFensingを利用したことを記載しています
Engineering
◦
Read more
4
Save
Share
Embed
Embed presentation
Download
Downloaded 12 times
1
/ 9
2
/ 9
3
/ 9
4
/ 9
5
/ 9
6
/ 9
7
/ 9
8
/ 9
9
/ 9
More Related Content
PPT
iOS ジオフェンシングで簡単リアル連動
by
OCHI Shuji
PDF
Realmを使ってみた話
by
Takahito Morinaga
PDF
ReNCoN_v0.6
by
Kentaro Higa
PDF
ReNCoN_V0.6
by
Kentaro Higa
KEY
Ojag20120811
by
Shusaku Fukumine
PDF
iBeacon (Lightning Talk @ NDS in Niigata #1)
by
Masashi MATSUI
PDF
ReNCoN
by
Kentaro Higa
PDF
ホットペッパービューティーアプリリプレイスとMVCP
by
Recruit Lifestyle Co., Ltd.
iOS ジオフェンシングで簡単リアル連動
by
OCHI Shuji
Realmを使ってみた話
by
Takahito Morinaga
ReNCoN_v0.6
by
Kentaro Higa
ReNCoN_V0.6
by
Kentaro Higa
Ojag20120811
by
Shusaku Fukumine
iBeacon (Lightning Talk @ NDS in Niigata #1)
by
Masashi MATSUI
ReNCoN
by
Kentaro Higa
ホットペッパービューティーアプリリプレイスとMVCP
by
Recruit Lifestyle Co., Ltd.
Featured
PDF
2024 Trend Updates: What Really Works In SEO & Content Marketing
by
Search Engine Journal
PDF
Storytelling For The Web: Integrate Storytelling in your Design Process
by
Chiara Aliotta
PDF
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...
by
OECD Directorate for Financial and Enterprise Affairs
PDF
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
by
SocialHRCamp
PDF
2024 State of Marketing Report – by Hubspot
by
Marius Sescu
PDF
Everything You Need To Know About ChatGPT
by
Expeed Software
PDF
Product Design Trends in 2024 | Teenage Engineerings
by
Pixeldarts
PDF
How Race, Age and Gender Shape Attitudes Towards Mental Health
by
ThinkNow
PDF
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
by
marketingartwork
PDF
Skeleton Culture Code
by
Skeleton Technologies
PDF
PEPSICO Presentation to CAGNY Conference Feb 2024
by
Neil Kimberley
PDF
Content Methodology: A Best Practices Report (Webinar)
by
contently
PPTX
How to Prepare For a Successful Job Search for 2024
by
Albert Qian
PDF
Social Media Marketing Trends 2024 // The Global Indie Insights
by
Kurio // The Social Media Age(ncy)
PDF
Trends In Paid Search: Navigating The Digital Landscape In 2024
by
Search Engine Journal
PDF
5 Public speaking tips from TED - Visualized summary
by
SpeakerHub
PDF
ChatGPT and the Future of Work - Clark Boyd
by
Clark Boyd
PDF
Getting into the tech field. what next
by
Tessa Mero
PDF
Google's Just Not That Into You: Understanding Core Updates & Search Intent
by
Lily Ray
PDF
How to have difficult conversations
by
Rajiv Jayarajah, MAppComm, ACC
2024 Trend Updates: What Really Works In SEO & Content Marketing
by
Search Engine Journal
Storytelling For The Web: Integrate Storytelling in your Design Process
by
Chiara Aliotta
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...
by
OECD Directorate for Financial and Enterprise Affairs
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
by
SocialHRCamp
2024 State of Marketing Report – by Hubspot
by
Marius Sescu
Everything You Need To Know About ChatGPT
by
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
by
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
by
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
by
marketingartwork
Skeleton Culture Code
by
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
by
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
by
contently
How to Prepare For a Successful Job Search for 2024
by
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
by
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
by
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
by
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
by
Clark Boyd
Getting into the tech field. what next
by
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
by
Lily Ray
How to have difficult conversations
by
Rajiv Jayarajah, MAppComm, ACC
AndroidでGeoFenceを使って見る
1.
ANDROIDでGEOFENCEを 使って見る 2014/12/13
2.
自己紹介 • 中谷 克紀 •
Twitter @KatsukiNakatani • 大阪のSIerでサーバ周りのエンジニアをしています(開発者ではないです) なので仕事で開発をすることはあんまりないです。 • Androidは基本趣味の世界です。 (でも今年初めて仕事でAndroid開発しました!) • 好きな言語はC# , JAVA ,最近Swiftも少し。
3.
GeoFenceって何? • GeoFenceとは特定の位置(場所)の周りに網(フェンス)を 張って、その網への出入りを検知してくれる機能です。 エリアに入る エリアから出る Google
IO 2013で発表されました。
4.
GeoFenceを利用するために • build.gradleへ依存関係を追加する dependencies { compile
'com.google.android.gms:play-services-location:6.5.+’ } ※GooglePlayServiceSDK 6.5より各機能が分割されました。(今まで通り フル機能を利用したい場合は下記の記述としてください) dependencies { compile 'com.google.android.gms:play-services:6.5.+’ }
5.
GoogleAPI Clientの初期化・接続 //インスタンスの初期化 public onCreate
(){ mApiClient = new GoogleApiClient.Builder(getApplicationContext()) .addApi(LocationServices.API) //利用するAPIの指定 .addConnectionCallbacks(this) //接続完了リスナ .addOnConnectionFailedListener(this) //接続失敗リスナ .build(); } //インスタンスの接続 public onResume(){ if(mApiClient != null){ mApiClient.connect(); //接続します } } //インスタンスの切断 public onPause(){ if(mApiClient != null){ mApiClient.disconnect(); //切断します } }
6.
GeoFenceを登録します @Override public void onConnected(Bundle
bundle) { //Connectされたら呼ばれます。 ArrayList<Geofence> fenceList = new ArrayList<>(); Geofence geofence = new Geofence.Builder() //Builderからフェンスを作成します .setRequestId(“Fence-1”) //フェンスのユニーク名前を設定します .setTransitionTypes(Geofence.GEOFENCE_TRANSITION_EXIT) //入・出を指定します .setCircularRegion(latitude,longuitude,100) //中心となる緯度・経度・半径を指定します .setExpirationDuration(Geofence.NEVER_EXPIRE) //チェックをする期限を指定します .build(); fenceList.add(geofence); //フェンスリストに追加します //イベント発生時に動作するPendingIntentを作成します Intent intent = new Intent(getApplicationContext(), NotificationService.class); PendingIntent pendingIntent = PendingIntent.getService(this, 0, intent,PendingIntent.FLAG_UPDATE_CURRENT); //AddGeofenceで、ApiClientとイベント検知用のフェンス、PendingIntentを渡します。 LocationServices.GeofencingApi.addGeofences(mApiClient, fenceList, pendingIntent); }
7.
これだけです すごく簡単でしょう!
8.
ちょっとハマったこと インターネットでググってよく出てくるコードではLocationClientを使用している コードが多く見られます SDK5.xxあたりからLocationClientはDeprcatedとなっており SDK6.5で完全に使えなくなったようです DeveloperPageもこの通り 実装する場合は、 LocationServices.GeofencingApiを使用した 方法を使ってください
9.
ご静聴ありがとうございました
Download