Android idmap 学习

代码路径: frameworks/base/cmds/idmap/

编译方法: make idmap

程序入口: main方法位于idmap.cpp

Binary在手机的路径: system/bin/idmap

查看帮助信息: adb shell idmap –help

帮助信息解读:

  • 名字:
    idmap - 创建或者显示idmap文件.
  • 概要:
    idmap –help 查看帮助信息.
    idmap –fd target overlay fd
    idmap –path target overlay idmap
    idmap –inspect idmap
  • 描述:
    Idmap files play an integral part in the runtime resource overlay framework. An idmap
    file contains a mapping of resource identifiers between overlay package and its target
    package; this mapping is used during resource lookup. Idmap files also act as control
    files by their existence: if not present, the corresponding overlay package is ignored
    when the resource context is created.

    Idmap files are stored in /data/resource-cache. For each pair (target package, overlay
    package), there exists exactly one idmap file, or none if the overlay should not be used

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Android中,Map是一个可以显示地图的控件。它使用地图API来获取地图数据,并提供了一些与地图交互的方法和事件。开发人员可以使用Map来显示不同类型的地图,如普通地图、卫星地图和混合地图。 为了使用Map,需要在AndroidManifest.xml文件中添加以下权限: ``` <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.INTERNET" /> ``` 同时还需要在布局文件中添加Map控件: ``` <fragment android:id="@+id/map" android:name="com.google.android.gms.maps.SupportMapFragment" android:layout_width="match_parent" android:layout_height="match_parent" /> ``` 在代码中,可以通过以下方式获取Map对象: ``` SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager() .findFragmentById(R.id.map); mapFragment.getMapAsync(this); ``` 在获取Map对象后,可以调用一些方法来设置地图的类型、缩放级别、标记等。例如,下面的代码将地图类型设置为卫星地图,并添加了一个标记: ``` @Override public void onMapReady(GoogleMap googleMap) { mMap = googleMap; mMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE); LatLng sydney = new LatLng(-34, 151); mMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney")); mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney)); } ``` 除此之外,还可以使用一些事件来响应地图上的操作,如点击标记、拖动地图等。 以上就是Android中Map的简介和基本用法。通过使用Map,开发人员可以轻松地在应用程序中显示地图,并与之交互。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值