æ°ãã API ã¯ä½¿ãããããªã、ãã¼ã«ã¼ãæ
å ±ã¦ã£ã³ãã¦ã®ä½æãç°¡åã§ã。ããªã©ã¤ã³ãããªã´ã³、ã°ã©ã¦ã³ã ãªã¼ãã¼ã¬ã¤、ã¿ã¤ã« ãªã¼ãã¼ã¬ã¤ã®ãããã、ãããæ°è¡ã®ã³ã¼ãã§ãããã«è¿½å ã§ããããã«ãªãã¾ãã。
ã¾ãã¯ä½¿ç¨éå§æé ã«å¾ã£ã¦ API ãã¼ãåå¾ããã®ã¡、SDK Manager ã§
Google Play éçºè
ãµã¼ãã¹ç¨ SDK ããã¦ã³ãã¼ããã¦è¨å®ãè¡ãã¾ã 。詳ãã㯠Google Maps for Android API ã®ããã¥ã¡ã³ããåç
§ãã¦ãã ãã。ãªã、
Android SDK ããã¦ã³ãã¼ã ãã¦ããªãæ¹ã¯、æåã«ãããè¡ãå¿
è¦ãããã¾ã。
ãã§ã«ä¸çä¸ã® 80 ä¸ãè¶
ãããµã¤ãã§、便å©ã§åªããã¢ããªã®ä½æã« Google ã®ãããç¨ API ã使ç¨ããã¦ãã¾ã。Google Maps API ãã¡ããªã¼ã«æ°ãã«å ãã£ããã® API ããæ´»ç¨ããã ã、ããã¾ã§ã¢ãã¤ã«ç«¯æ«ä¸ã§ä¸å¯è½ã ã£ããããä½é¨ã®æ§ç¯ã«å½¹ç«ã¦ã¦ããã ããã°ã¨æãã¾ã。
ãªã、æ°ãã API ã®ä½¿ãæ¹ã«ã¤ãã¦è©³ããç¥ãããæ¹ã¯、ä¸è¨ã® Google Developers Live ã®åç»ãã覧ãã ãã。
Photo Sphere
Android 4.2 ã§ã¯、Google ãããã®ã¹ããªã¼ããã¥ã¼ã®ãããªè¨å ´æããµããç´ æ´ãããããã©ãåçã®ä½æãå¯è½ãª「
Photo Sphere 」ã¢ã¼ããã«ã¡ã©ã«æè¼ãã¾ãã。ãã®ãã³、ãã¸ãã¹ãéã³ã®å ´ã§ã® Photo Sphere ã®æ°ããªç¨éã模索ããéçºè
ãä¼æ¥、ã¾ãã«ã¡ã©ãã³ã®æ¹ã
ã«ãå©ç¨ããã ãã
æ°ã㪠API ã¨ãã®ããã¥ã¡ã³ã ãå
¬éãã¾ãã。
Photo Sphere ã¯
ãªã¼ãã³ ãã©ã¼ããã ãªã®ã§èª°ã§ãä½æã§ã、ã¦ã§ããã¢ãã¤ã«ç«¯æ«ä¸ã§è¡¨ç¤ºããããã¨ãã§ãã¾ã。
Photo Sphere ã¯ç°¡åã«è¨ã㨠JPG ã®ãããªç»åãã¡ã¤ã«ã§、ä¸ã«ããã¹ããã¼ã¹ã®ã¡ã¿ãã¼ã¿ (Adobe ãä½æãã XMP ã¨ãã°ãããªã¼ãã³ ãã©ã¼ããã) ãåãè¾¼ã¾ãã¦ãã¾ã。ã¡ã¿ãã¼ã¿ã«ã¯ Photo Sphere ã®å¯¸æ³ã、Android ã Google+、Google ãããã«ããã¤ã³ã¿ã©ã¯ãã£ã Photo Sphere ãã¥ã¼ã¢ã¼å
ã§ã®ã¬ã³ããªã³ã°æ¹æ³ãè¨è¿°ããã¾ã。
Android ã® Photo Sphere ã«ã¡ã©ä»¥å¤ã§ä½æãããããã©ãç»åã« XMP ã¡ã¿ãã¼ã¿ãæåã¾ãã¯ããã°ã©ã ã§è¿½å ãããå ´åã¯、ã¡ã¿ãã¼ã¿ã®è©³ç´°、ãªãã³ã«ããã°ã©ã ã使ã£ã¦ã¡ã¿ãã¼ã¿ãåçã«å¾ä»ãããæ¹æ³ã«ã¤ãã¦ã®è¨äºã®å
¬éããå¾
ã¡ãã ãã。
æ°ãã¼ã¸ã§ã³ã® Google Play ãµã¼ãã¹ã§ã¯、ç»åã Photo Sphere ãã©ããã確èªãã¦ãã Photo Sphere ãã¥ã¼ã¢ã¼ã§éãã¨ãã
API ã追å ãã¾ãã。
// This listener will be called with information about the given panorama.
//(ãã®ãªã¹ãã¼ã¯、æå®ãããããã©ãã«é¢ããæ
å ±ã¨ä¸ç·ã«å¼ã³åºããã¾ã。)
OnPanoramaInfoLoadedListener infoLoadedListener =
new OnPanoramaInfoLoadedListener () {
@Override
public void onPanoramaInfoLoaded ( ConnectionResult result ,
Intent viewerIntent ) {
if ( result . isSuccess ()) {
// If the intent is not null, the image can be shown as a
// panorama.
//(ã¤ã³ãã³ãã null 以å¤ã®å ´åã¯、ç»åã¯ããã©ãã§è¡¨ç¤ºå¯è½ã§ã。)
if ( viewerIntent != null ) {
// Use the given intent to start the panorama viewer.
//(æå®ãããã¤ã³ãã³ãã使ç¨ãã¦ããã©ã ãã¥ã¼ã¢ã¼ãèµ·åãã¾ã。)
startActivity ( viewerIntent );
}
}
// If viewerIntent is null, the image is not a viewable panorama.
//(viewerIntent ã null ã®å ´åã¯、ç»åã¯è¡¨ç¤ºå¯è½ãªããã©ãç»åã§ã¯ããã¾ãã。)
}
};
// Create client instance and connect to it.<
//(ã¯ã©ã¤ã¢ã³ã ã¤ã³ã¹ã¿ã³ã¹ãä½æã、ããã«æ¥ç¶ãã¾ã。)
PanoramaClient client = ...
...
// Once connected to the client, initiate the asynchronous check on whether
// the image is a viewable panorama.
//(ã¯ã©ã¤ã¢ã³ãã«æ¥ç¶å¾、ç»åã表示å¯è½ãªããã©ãç»åãã©ãã、
//éåæãã§ãã¯ãéå§ãã¾ã。)
client . loadPanoramaInfo ( infoLoadedListener , panoramaUri );
Google Play ãµã¼ãã¹ã API ã«ã¤ãã¦ãã£ã¨ããããç¥ãããæ¹ã¯ Android Developers ãµã¤ãã«æ°ãã«è¨ãããã
Google Services ã®ãã¼ã¸ ãã覧ãã ãã。
Posted by å±±å´å¯ç¾ Developer Relations Team
[æ¬è¨äºã¯、Reto Meier、Evan Rapoport、Andrew Foster ã Android Developers Blog ã«æ稿ãã「New Google Maps Android API now part of Google Play services 」ã¨ããè¨äºã¨、Google Maps ã® Senior Product Manager ã§ãã Andrew Foster ã Google Geo Developers Blog ã«æ稿ãã「Better maps in your Android apps! 」ã¨ããè¨äºãå
ã«ç¿»è¨³・ä½æãã¦ãã¾ã。詳ããã¯å
è¨äºãã覧ãã ãã。-å±±å´]
Google Play ãµã¼ãã¹ã¯、çãããéçºããã¢ããªã Google ãããã¯ãã¨ã¹ã ã¼ãºã«çµ±åã、æ°æ©è½ãç´ æ©ãå±éãã¢ããªã§ä½¿ç¨ã§ããããã«ããããã®æ°ããªãã©ãããã©ã¼ã ã§ã。ãã®ãã³、Google Play ãµã¼ãã¹ v2.0 ãå
¬éãã¾ãã。æ°ã㪠API ã 2 ã¤å«ã¾ãã¦ãã、ãã®ãã¡ã® 1 ã¤ã¯ã¢ããã°ã¬ã¼ãã®è¦æãããããæãå¤ãããã ç¨ API ã§ã。
Google Maps Android API
éçºè
ã¯ãã®æ°ãã¼ã¸ã§ã³ã® API ã«ãã£ã¦、Android åã Google ãããã®æ°å¤ãã®ææ°æ©è½ã Android ã¢ããªã«åãå
¥ãããã¨ãã§ããããã«ãªãã¾ã。ãã® API ã Google Play éçºè
ãµã¼ãã¹ã®ä¸é¨ã¨ãã¦ãæä¾ã§ãããã¨ã大å¤å¬ããæãã¾ã。Froyo 以é (API ã¬ãã«8+) ã®ç«¯æ«ã«å¯¾å¿ãã¦ãã¾ã。
æ°ã㪠API ã§ã¯ 2D ããã³ 3D ãã¥ã¼ 対å¿ã®ãã¯ã¿ã¼ãã¼ã¹ã®ããã ã使ç¨ã、ã¦ã¼ã¶ã¼ã¯ã·ã³ãã«ãªã¸ã§ã¹ãã£ã¼ã§ãããã®å¾æãå転 æä½ãã§ãã¾ã。è¡æåçããã¤ããªãã表示、å°å½¢ã交éç¶æ³ã¨ãã£ã Google ãããã§ããªãã¿ã®å種ã¬ã¤ã¤ã¼ã«å ã、æ° API ã§ã¯ä¸»è¦ãªç©ºæ¸¯ãã·ã§ããã³ã°ã»ã³ã¿ã¼ã®ã¤ã³ã㢠ããã ãã¢ããªã«è¿½å ã§ããããã«ãªãã¾ã。
Android ã«ã¤ãã¦æãå¤ããªã¯ã¨ã¹ããå¯ããããæ©è½ã® 1 ã¤ãããã ãã©ã°ã¡ã³ã 対å¿ã§ã。æ°ãã¼ã¸ã§ã³ã® API ã§ã¯、ãããã®ã¢ã¯ãã£ããã£ã¸ã®è¿½å ã¯、ä¸è¨ã«ç¤ºããããªã·ã³ãã«ãªæ¹æ³ã«ãªãã¾ã。
<fragment
android:id = "@+id/map"
android:layout_width = "match_parent"
android:layout_height = "match_parent"
class = "com.google.android.gms.maps.MapFragment" />
ãã®ç»åã¯、売家ãè³è²¸ç©ä»¶ã 3D ã§æ¤ç´¢ã§ãã Android ã¢ããª「Trulia 」ã®ã¢ãããã¼ãçã§ã覧ããã ãã¾ã。
æ°ãã API ã¯ä½¿ãããããªã、ãã¼ã«ã¼ãæ
å ±ã¦ã£ã³ãã¦ã®ä½æãç°¡åã§ã。ããªã©ã¤ã³ãããªã´ã³、ã°ã©ã¦ã³ã ãªã¼ãã¼ã¬ã¤、ã¿ã¤ã« ãªã¼ãã¼ã¬ã¤ã®ãããã、ãããæ°è¡ã®ã³ã¼ãã§ãããã«è¿½å ã§ããããã«ãªãã¾ãã。
ã¾ãã¯ä½¿ç¨éå§æé ã«å¾ã£ã¦ API ãã¼ãåå¾ããã®ã¡、SDK Manager 㧠Google Play éçºè
ãµã¼ãã¹ç¨ SDK ããã¦ã³ãã¼ããã¦è¨å®ãè¡ãã¾ã 。詳ãã㯠Google Maps for Android API ã®ããã¥ã¡ã³ããåç
§ãã¦ãã ãã。ãªã、Android SDK ããã¦ã³ãã¼ã ãã¦ããªãæ¹ã¯、æåã«ãããè¡ãå¿
è¦ãããã¾ã。
ãã§ã«ä¸çä¸ã® 80 ä¸ãè¶
ãããµã¤ãã§、便å©ã§åªããã¢ããªã®ä½æã« Google ã®ãããç¨ API ã使ç¨ããã¦ãã¾ã。Google Maps API ãã¡ããªã¼ã«æ°ãã«å ãã£ããã® API ããæ´»ç¨ããã ã、ããã¾ã§ã¢ãã¤ã«ç«¯æ«ä¸ã§ä¸å¯è½ã ã£ããããä½é¨ã®æ§ç¯ã«å½¹ç«ã¦ã¦ããã ããã°ã¨æãã¾ã。
ãªã、æ°ãã API ã®ä½¿ãæ¹ã«ã¤ãã¦è©³ããç¥ãããæ¹ã¯、ä¸è¨ã® Google Developers Live ã®åç»ãã覧ãã ãã。
Photo Sphere
Android 4.2 ã§ã¯、Google ãããã®ã¹ããªã¼ããã¥ã¼ã®ãããªè¨å ´æããµããç´ æ´ãããããã©ãåçã®ä½æãå¯è½ãª「Photo Sphere 」ã¢ã¼ããã«ã¡ã©ã«æè¼ãã¾ãã。ãã®ãã³、ãã¸ãã¹ãéã³ã®å ´ã§ã® Photo Sphere ã®æ°ããªç¨éã模索ããéçºè
ãä¼æ¥、ã¾ãã«ã¡ã©ãã³ã®æ¹ã
ã«ãå©ç¨ããã ããæ°ã㪠API ã¨ãã®ããã¥ã¡ã³ã ãå
¬éãã¾ãã。
Photo Sphere ã¯ãªã¼ãã³ ãã©ã¼ããã ãªã®ã§èª°ã§ãä½æã§ã、ã¦ã§ããã¢ãã¤ã«ç«¯æ«ä¸ã§è¡¨ç¤ºããããã¨ãã§ãã¾ã。
Photo Sphere ã¯ç°¡åã«è¨ã㨠JPG ã®ãããªç»åãã¡ã¤ã«ã§、ä¸ã«ããã¹ããã¼ã¹ã®ã¡ã¿ãã¼ã¿ (Adobe ãä½æãã XMP ã¨ãã°ãããªã¼ãã³ ãã©ã¼ããã) ãåãè¾¼ã¾ãã¦ãã¾ã。ã¡ã¿ãã¼ã¿ã«ã¯ Photo Sphere ã®å¯¸æ³ã、Android ã Google+、Google ãããã«ããã¤ã³ã¿ã©ã¯ãã£ã Photo Sphere ãã¥ã¼ã¢ã¼å
ã§ã®ã¬ã³ããªã³ã°æ¹æ³ãè¨è¿°ããã¾ã。
Android ã® Photo Sphere ã«ã¡ã©ä»¥å¤ã§ä½æãããããã©ãç»åã« XMP ã¡ã¿ãã¼ã¿ãæåã¾ãã¯ããã°ã©ã ã§è¿½å ãããå ´åã¯、ã¡ã¿ãã¼ã¿ã®è©³ç´°、ãªãã³ã«ããã°ã©ã ã使ã£ã¦ã¡ã¿ãã¼ã¿ãåçã«å¾ä»ãããæ¹æ³ã«ã¤ãã¦ã®è¨äºã®å
¬éããå¾
ã¡ãã ãã。
æ°ãã¼ã¸ã§ã³ã® Google Play ãµã¼ãã¹ã§ã¯、ç»åã Photo Sphere ãã©ããã確èªãã¦ãã Photo Sphere ãã¥ã¼ã¢ã¼ã§éãã¨ãã API ã追å ãã¾ãã。
// This listener will be called with information about the given panorama.
//(ãã®ãªã¹ãã¼ã¯、æå®ãããããã©ãã«é¢ããæ
å ±ã¨ä¸ç·ã«å¼ã³åºããã¾ã。)
OnPanoramaInfoLoadedListener infoLoadedListener =
new OnPanoramaInfoLoadedListener () {
@Override
public void onPanoramaInfoLoaded ( ConnectionResult result ,
Intent viewerIntent ) {
if ( result . isSuccess ()) {
// If the intent is not null, the image can be shown as a
// panorama.
//(ã¤ã³ãã³ãã null 以å¤ã®å ´åã¯、ç»åã¯ããã©ãã§è¡¨ç¤ºå¯è½ã§ã。)
if ( viewerIntent != null ) {
// Use the given intent to start the panorama viewer.
//(æå®ãããã¤ã³ãã³ãã使ç¨ãã¦ããã©ã ãã¥ã¼ã¢ã¼ãèµ·åãã¾ã。)
startActivity ( viewerIntent );
}
}
// If viewerIntent is null, the image is not a viewable panorama.
//(viewerIntent ã null ã®å ´åã¯、ç»åã¯è¡¨ç¤ºå¯è½ãªããã©ãç»åã§ã¯ããã¾ãã。)
}
};
// Create client instance and connect to it.<
//(ã¯ã©ã¤ã¢ã³ã ã¤ã³ã¹ã¿ã³ã¹ãä½æã、ããã«æ¥ç¶ãã¾ã。)
PanoramaClient client = ...
...
// Once connected to the client, initiate the asynchronous check on whether
// the image is a viewable panorama.
//(ã¯ã©ã¤ã¢ã³ãã«æ¥ç¶å¾、ç»åã表示å¯è½ãªããã©ãç»åãã©ãã、
//éåæãã§ãã¯ãéå§ãã¾ã。)
client . loadPanoramaInfo ( infoLoadedListener , panoramaUri );
Google Play ãµã¼ãã¹ã API ã«ã¤ãã¦ãã£ã¨ããããç¥ãããæ¹ã¯ Android Developers ãµã¤ãã«æ°ãã«è¨ãããã Google Services ã®ãã¼ã¸ ãã覧ãã ãã。