`

Replacing System Application (like Maps)

阅读更多

What you learn:  You will learn how to catch/replace  the System Applicatio  for example the Maps-Activity. 

Idea  Designed/Tested with sdk-version:  m5-rc15  

Difficulty:  1.5 of 5 Smile  

Idea  Questions/Problems:  Simply post below... 

Description:

  1. Create a standard application as always 
  2. Search for the Activity you want in the dump of the Android internal XML-files (load it Source  Android - Internal XML dumped
    • As we want to replace the Maps Activity we search for sth. like "Maps" and in /android-system-apks/Maps/AndroidManifest.xml " we find what we want.

 

<?xml version="1.0" encoding="utf-8"?> 
<manifest 
     xmlns:android="http://schemas.android.com/apk/res/android" 
     android:sharedUserId="com.google.android.core" 
     android:signature="com.google" 
     package="com.google.android.maps"> 
      
     <permission 
          android:label="@string/read_perm_label" 
          android:name="com.google.android.maps.permission.READ_MY_MAPS" 
          android:description="@string/read_perm_desc" /> 
     .... 
     <uses-permission android:name="android.permission.ACCESS_GPS" /> 
     .... 
      
     <application 
          android:theme="@android:style/Theme.Dark" 
          android:icon="@drawable/ic_launcher_maps" 
          android:taskAffinity="com.google.android.maps"> 
           
          <activity 
               android:label="@string/maps_label" 
               android:name="Maps" 
               android:launchMode="singleTop"> 
                    .... 
               <!-- THIS IS WHAT WE WANT --> 
               <intent-filter android:label="@string/google_maps_label"> 
                    <action android:name="android.intent.action.VIEW" /> 
                    <category android:name="android.intent.category.DEFAULT" /> 
                    <category android:name="android.intent.category.BROWSABLE" /> 
                    <data android:scheme="geo" /> 
               </intent-filter> 
               <!-- UP TO HERE --> 
               .... 
          </activity> 
     .... 
     </application> 
</manifest>

 

3. Open your own AndroidManifest.xml and register the Activity you want your app to listen to it in the AndroidManifest.xml in the following way:

 <activity class=".MyJustCreatedApplication" android:label="@string/app_name"> 
          <intent-filter> 
               <action android:name="android.intent.action.VIEW" /> 
               <category android:name="android.intent.category.DEFAULT" /> 
               <category android:name="android.intent.category.BROWSABLE" /> 
               <data android:scheme="geo" /> 
          </intent-filter> 
        </activity> 

 4.Run the app once and close it (just that it gets installed on the emulator ).

5.The next time an Intent with a "geo"-uri scheme is broadcasted our app will get started or at least... 6. The system will ask you which one of two available activities  you want to use to handle the VIEW-Action on the "geo"-scheme:

     1.- the 1st  one is the "Maps" standard system activity

      2. - the 2nd  one should be yours

7. Test this it with another app that executes the following line:

 

startActivity(new Intent(android.content.Intent.VIEW_ACTION, Uri.parse("geo:49.473367,8.660274")));
 
分享到:
评论

相关推荐

    AFF A800 - Replacing system DIMMs.pdf

    在本文档中,我们将深入探讨如何在AFF A800系统中更换系统DIMM(Dual In-line Memory Modules)。这是对存储设备进行维护和故障排除的关键步骤,以确保系统的稳定运行和数据完整性。以下是对该过程的详细说明: ...

    AFF A700s - Replacing system DIMMs.pdf

    在IT行业中,内存(DIMM,Dual In-line Memory Module)是服务器硬件的重要组成部分,负责存储和处理数据。在NetApp的AFF A700s存储系统中,内存的稳定性与性能直接影响到整个系统的运行效率和数据处理能力。...

    FAS8300 and FAS8700 - Replacing system DIMMs.pdf

    - 如果启用了AutoSupport,可以通过在健康节点的控制台上禁用自动回切并发送MAINT消息来抑制自动案例创建,例如:`system node autosupport invoke -node * -type all -message MAINT=2h`,这将抑制自动案例创建两...

    Windows System Programming 4th 原版pdf by Hart

    replacing the POSIX API (supported by UNIX and Linux) as the preferred API for applications targeted at desktop, server, and embedded systems now and for the indefinite future. Many programmers, ...

    Solaris 10 System Administration Essentials

    5.3.10 Replacing a Disk 127 5.4 NFS File System Administration 127 5.4.1 Finding Available NFS File Systems 128 5.4.2 Mounting an NFS File System 129 5.4.3 Unmounting an NFS File System 129 5.4.4 Con?...

    AFF A320 - Replacing PCIe cards.pdf

    标题中的"AFF A320 - Replacing PCIe cards"指的是在NetApp的AFF A320存储系统中更换PCI Express (PCIe) 卡的过程。这个过程涉及到一系列步骤,包括关闭受影响的控制器、移除和更换PCIe卡、重新安装模块以及运行诊断...

    FAS9000 - Replacing the controller module.pdf

    接下来是"Replacing the controller module硬件"。这个过程包括打开控制器模块,移除旧的控制器,然后安装新的控制器。在操作过程中,需要小心处理敏感的硬件组件,如"Moving the boot media"(移动引导媒体)和...

    FAS2700 - Replacing the controller module.pdf

    在本文中,我们将深入探讨如何在FAS2700和AFF A220系统中更换控制器模块。这个过程对于确保存储系统的稳定性和数据安全至关重要,因为控制器是系统的核心组件,负责管理和执行各种存储操作。 首先,我们来看一下...

    Replacing_a_controller_module_in_a_32xx_Data.pdf

    在IT行业中,NetApp是一家知名的存储解决方案提供商,其FAS3200系列是企业级存储系统,用于处理大量数据并提供高可用性。本文档详细介绍了在Data ONTAP 8.1.x或更早版本上运行的32xx系统中如何更换控制器模块。...

    DB - Just Say NO to Paxos Overhead- Replacing Consensus xxx.pdf

    DB - Just Say NO to Paxos Overhead- Replacing Consensus with Network Ordering.pdf Distributed applications use replication, implemented by protocols like Paxos, to ensure data availability and ...

    Replacing ICON resources in .exe .dll files

    Replacing ICON resources in .exe .dll files The purpose of this article is to explain the structures associated with an ico file and an icon resource. The code examples will demonstrate the use of ...

    myeclipse_10.5_crack(破解工具)

    Replacing [SignatureVerifier ]. Done. Replacing [publicKey.bytes]. replacing file [${eclipse_home}\plugins\com.genuitec.eclipse.core_10.5.0.me201206170059.jar] and create bakFile [${eclipse_home}\...

    AFF A200 - Replacing the chassis.pdf

    本文档“AFF A200 - Replacing the Chassis.pdf”提供了NetApp AFF A200系统更换机箱的具体步骤。NetApp AFF A200是一款高性能的全闪存存储阵列,其支持最新的ONTAP操作系统,用于企业级的数据存储和管理。 在进行...

    AFF A250 - Replacing a fan.pdf

    在本文档"AFF A250 - Replacing a fan.pdf"中,主要涉及的是如何对NetApp的AFF A250存储系统进行风扇更换的详细步骤。这是一项关键的维护任务,因为散热风扇对于保持系统的稳定运行至关重要。下面将详细介绍整个过程...

    AFF C190 - Replacing DIMMs.pdf

    system node autosupport invoke -node * -type all -message MAINT=number_of_hours_down 例如,以下命令将关闭AutoSupport的自动案例创建功能两个小时: cluster1:*&gt; system node autosupport invoke -node * -...

    myeclipse 10.5 破解

    Replacing [SignatureVerifier ]. Done. Replacing [publicKey.bytes]. replacing file [${eclipse_home}\plugins\com.genuitec.eclipse.core_10.5.0.me201206170059.jar] and create bakFile [${eclipse_home}\...

    AFF A320 - Replacing the boot media.pdf

    标题中的"AFF A320 - Replacing the boot media"是指NetApp的A320存储阵列系统中关于更换引导介质的操作指南。这通常涉及到存储设备的核心操作系统——ONTAP的维护工作,确保系统的正常运行和数据安全性。 描述中...

    FAS8200 - Replacing DIMMs.pdf

    在本文档中,标题“FAS8200 - Replacing DIMMs”和描述涉及到的是在FAS8200存储系统中更换内存模块(DIMMs)的过程,这是由于系统检测到越来越多的可纠正错误校验码(ECC),如果不进行更换可能会导致系统崩溃。...

    AFF A800 - Replacing the RTC battery.pdf

    标题中的"AFF A800 - Replacing the RTC battery.pdf"指示了这是一份关于NetApp AFF A800系统中RTC(Real-Time Clock)电池更换的指南。这份文档可能是针对系统管理员或IT专业人员的,他们需要了解如何在不影响业务...

    AFF A320 - Replacing an NVDIMM.pdf

    system node autosupport invoke -node * -type all -message MAINT=number_of_hours_down ``` 例如,以下命令将自动创建支持案例的时间抑制为2小时: ``` cluster1:*&gt; system node autosupport invoke -node *...

Global site tag (gtag.js) - Google Analytics