有没有办法永久关闭Google地图,直到需要? -- 2.2-froyo 领域 和 google-maps 领域 和 intents 领域 和 disable-app 领域 和 auto-start 领域 android 相关 的问题

Is there a way to permanently turn off Google Maps until needed?


简体版||繁體版
24
vote

问题

中文

谷歌地图似乎对它注册了疯狂的意图,以及其他开始的方式。

因为这是一个漂亮的资源饥饿的应用程序(尤其是记忆力),我非常希望它永久性未运行/直到我实际需要它。但是,Android一直在一直开始 - 例如,当连接状态发生变化时(对于我频繁地发生在室内),或GPS /网络位置发生变化。

是否有一些方法可以确保Google地图不会启动任何进程,保证,直到我点击图标故意启动它?

环境:droid x,跑rooted froyo 2.2;我有 autoStarts 。和高级任务杀手,以及安装的钛版备份。

我对几乎任何方法都很开放,只要

  • 它是可靠的。

  • 它让我使用100%预期功能的谷歌地图,无需5分钟的工作来重新配置。

  • 理想情况下,不需要我重新启动使用它,但这一个不是交易杀手。

  • 我将强烈更喜欢一种通用方法,该方法适用于其他应用,而不仅仅是谷歌地图。

  • 我是一个具有巨大剂量的UNIX / Linux系统管理体验的软件开发人员。换句话说,非常欢迎需要Shell提示或编写/运行/运行shell脚本(或erl中的perl中的解决方案非常欢迎。

    涉及写作我自己的Java Android应用程序是可以接受的,只要它们详细地详细介绍了一个总Android开发,新手可以在没有100%丢失的情况下完成一些工作。

我尝试的东西:

  • 通过任务杀手杀死流程是不起作用的 - 它们会立即或一段时间备份。可能通过意图但不是100%肯定。

  • 摆脱GMAPS问题的标准方法(退出纬度/关闭GPS和网络定位器)。这似乎有很多帮助,但我发现需要永久关闭GPS /定位器来难以接受 - 例如。它不会让我运行基于区域设置的应用程序或基于区域设置的任务事项。

    通过钛备用专业冻结
  • 冻结。这需要重新启动,通常不是很愉快。

我认为(但不知道如何做)的可能方法是:

  • 以某种方式完全消除(关闭)谷歌地图未经需要的所有意图。

    问题:首先,我不知道所有意图谷歌地图使用了什么。

    第二,我所知道的是唯一的实用方式是自动启动应用程序,这不是一个可行的解决方案 - 它需要〜5-10分钟来查找并重新启用所有意图我知道< / strong>(自动驾驶员在每次应用程序意图管理中真的很差 - 它以每意图为中心),难以介意自动启动不知道的可能意图(这是一个黑匣子,我不知道哪个意图错过了哪些意图。

  • 有一个脚本,它将重命名jar或任何可执行文件在Android上的可执行文件(整个.apk?)从Say abcdefghijklmn0 GoogleMaps.disabled.apk 和back。

    问题:我不知道是否可以在植根于植物的froyo上做。此外,Google地图已预先安装在DROIDX上,因此不某种方式重命名只会影响更新但不是原始应用程序?

  • 有一个脚本,它将进入APK和重命名/移动/清空清单文件,以删除该应用程序的任何意图。

    问题:这需要重新编译吗?它肯定需要重新启动,这是一个减号

english

Google maps seems to have an insane amount of Intents registered for it, as well as other ways of being started.

Since this is a pretty resource hungry app (especially memory wise), I would very much want it permanently not running unless/until I actually need it. However, Android keeps starting it all the time - for example, when the connectivity status changes (which for me happens pretty frequently indoors), or GPS/network location changes.

Is there some way of ensuring that Google Maps doesn't start ANY processes, guaranteed, until I click on an icon to deliberately launch it?

Environment: Droid X, running rooted stock Froyo 2.2; I have Autostarts. and Advanced Task Killer, as well as Pro version of Titanium Backup installed.

I'm fairly open to almost any method as long as

  • It's reliable.

  • It lets me use Google Maps with 100% intended functionality once I DO need it, without requiring 5 minutes of work to re-configure.

  • Ideally, doesn't require me to reboot to use it, but this one is not a deal killer.

  • I would STRONGLY prefer a generic method which would be applicable to other applications, NOT just Google Maps.

  • I'm a software developer with a hefty dose of Unix/Linux system administration experience. In other words, solutions which require shell prompt or writing/running shell scripts (or Perl in Android Scripting Environment) are extremely welcome.

    Solutions involving writing my own Java Android app are acceptable as long as they are detailed enough than a total Android development newbie can get at least some work done without being 100% lost.

Things I tried:

  • Killing the processes via Task Killer is NOT working - they come back up, either immediately or in a little while. Probably via Intents but not 100% certain.

  • Standard methods of getting rid of GMaps issues (log out of Latitude/shut down GPS and network locator). This seems to help a lot BUT I find the need to permanently shut down GPS/locator to be unacceptable - e.g. it won't let me run Locale app or locale-based Tasker things.

  • Freeze via Titanium Backup Pro. This requires a reboot and generally not very pleasant.

Possible approaches I thought of (but don't know how to do) are:

  • Somehow FULLY eliminate (turn off) all Intents registered by Google Maps when not needed.

    Problems: First, I don't know what ALL the Intents Google Maps uses.

    Second, the only practical way of doing that that I know of is Autostarts app which is NOT a workable solution - it takes ~5-10 mins to find and re-enable all the intents I am aware of (Autostarts is really poor at per-app intent management - it's centered on per-intent), never mind possible intents that Autostarts does NOT know about (it's a black box, I don't know which intents are missed if any.

  • Have a script which will rename the JARs or whatever the executable files on Android are (entire .APK?) from say GoogleMaps.apk to GoogleMaps.disabled.apk and back.

    Problem: I don't know if this is possible to do on a rooted Froyo. Also, Google Maps was pre-installed on DroidX, so would renaming somehow ONLY affect the update but not the original app?

  • Have a script which will go into the APK and rename/move/empty out manifest file to remove any intents for that app.

    Problem: Would this require a recompile? It definitely requires a reboot which is a minus

              
         
         

回答列表

16
 
vote

first,我建议你停止使用你的任务杀手。他们比保存你的电量。系统在需要运行时重新启动服务,这导致电池使用。

第二,你是假设释放记忆是一件好事。它不是。释放内存不会降低电池使用。您真正需要寻找的是使用大量CPU周期的应用程序。这是耗尽电池的。

Android基于Linux。 Linux总是希望使用所有可用的内存,因为浪费内存。 Android系统将负责释放不使用的应用程序的内存,因此其他应用程序可以在需要时使用它。

即使您尝试杀死正在运行和占用内存的应用程序,系统也将重新启动这些服务/应用程序,这将导致电池流失,因为它们可能在启动时发生一些同步,或者只是CPU周期发生用于初始化应用程序的初始化。杀死应用程序还将导致设备在尝试启动应用程序时出现速度,因为现在需要在呈现应用程序用户界面之前需要启动备份的东西。

一些将导致电池流失的东西,如GPS,Wifi,蓝牙和数据使用情况将使用CPU更多处理正在传输和接收的数据。当不使用时,将这些关闭将节省大量的电池漏极。我的设备上有一个糟糕的电池,它甚至收费超过94%,但如果我在不需要它们时关闭这些服务,我可以获得12小时或更长时间。

我一直使用谷歌地图,并且在我的电池统计中,它甚至没有使用资源作为应用程序。我最高的电池用户是@ 31%的屏幕,最低显示的是Gmail @ 3%。我可以向您保证,谷歌地图不是电池漏极的原因。使用任务杀手更有可能是原因。正如我所说,我几乎每天使用Google地图的方向,即使在使用电池的前10个应用程序中。

更多关于谷歌Android开发人员博客< / a>。

对Android多任务处理的常见误解是过程和应用程序之间的区别。在Android中,这些不是紧密耦合实体:应用程序似乎在没有当前运行应用程序的实际进程的情况下出现给用户;多个应用程序可以共享进程,或者一个应用程序可以根据其需求使用多个流程;即使该应用程序没有主动做某事,也可以通过Android保持应用程序的过程。

您可以看到应用程序的进程"运行" 并不意味着应用程序正在运行或执行任何操作。它可能只是在那里,因为Android需要它在某些时候,并决定最好地保持它,以防它再次需要它。同样,您可能会留下一点申请并从您离开的位置返回它,并且在此期间Android可能需要摆脱其他事情的过程。

如何以这种方式处理Android处理应用程序的应用程序是流程不会干净地关闭。当用户离开应用程序时,它的进程在后台保持在后面,允许它在需要时继续工作(例如下载网页),如果用户返回它,立即到达前台。如果设备从未运行过内存,则Android将保留所有这些流程,真正将所有时间留出所有的应用程序。

当然,有一个有限的内存,并容纳这个Android必须决定何时何时摆脱不需要的进程。 这导致了Android的进程生命周期,它用于决定每个进程的重要性以及因此应该删除的内容的规则。 这些规则是基于一个过程对于用户当前体验的重要性,以及自用户最后一次需要的过程以来的时间。

一旦Android确定它需要删除一个过程,它就粗暴地确实强行杀死它。 然后,内核可以立即回收过程所需的所有资源,而无需依赖于该应用程序写得很好地写入并响应于有礼貌的退出请求。 允许内核立即回收应用程序资源 更容易避免严重的内存情况。

如果用户稍后返回到已被杀死的应用程序,Android需要一种方法来以与上次看到的相同状态重新启动它,以保留"所有应用程序运行所有时间" 体验。这是通过跟踪用户知道(活动)的应用程序的部分来完成的,并以关于它们所见的最后一个状态的信息重新启动它们。每次用户离开该部分时都会生成最后一个状态应用程序,而不是当它被杀死时,使内核可以在不依赖于应用程序在此点响应的情况下自由杀死它。

在某些方面,Android的流程管理可以被视为交换空间的形式:应用程序进程表示一定数量的内存内存;当内存低时,可以杀死一些过程(换出);当再次需要这些过程时,可以从上一个保存状态重新启动它们(交换)。

这是另一篇文章谈论的是任务杀手如何耗尽电池。

请勿使用自动任务杀害软件
要制作一个长话短说,使用自动任务杀手可能会导致:电池过多(仿佛手机已经足够快地排出电池),手机经常过热和程序随机关闭(崩溃) - 程序实际上想使用。远离这些!

如果您真正设置在"停止地图" 上,您可以做的一件事,直到要使用它就会使用Titanium Backup中的Freeze选项。 这将基本上从设备中删除应用程序,并且没有与其关联的服务都不会开始,直到您冻结它。

 

First, I suggest you stop using your task killers. They are draining your battery more than saving it. The System is restarting the services when they need to run which is causing battery usage.

Second, you are under the assumption that freeing up memory is a good thing. It is not. Freeing up memory is not going to decrease battery usage. What you really need to look for is the apps that use a lot of CPU cycles. This is what will drain your battery.

Android is based on Linux. Linux always wants to use all the memory available because free memory is wasted memory. The android system will take care of releasing memory of applications that are not in use so other applications can use it when needed.

Even if you try and kill applications that are running and taking up memory, the system will either restart these services/apps, which will cause battery drain because they probably have some syncing that happens when starting up, or just the CPU cycles that are used to initialize the application. Killing the applications will also cause the device to appear slow when trying to start applications because something that normally might be running now needs to be started back up before presenting you with the applications user interface.

Some things that will cause battery drain like GPS, wifi, bluetooth, and data usage are going to use your CPU a lot more to process the data that is being transmitted and received. Turning these off when not in use will save on a lot of battery drain. I have a bad battery in my device, it wont even charge past 94%, but I can get 12 or more hours out of my battery if I turn off these services when I don't need them.

I use google maps all the time, and in my battery stats its not even listed as an app using resources. My highest battery user is the Screen @ 31%, and the lowest shown is GMail @ 3%. I can assure you, google maps is not the cause of your battery drain. Using task killers is more likely the cause. As I said I use google maps for directions almost daily, and it isn't even in the top 10 list of apps that are using my battery.

More information on task killers from the Google Android Developers blog.

A common misunderstanding about Android multitasking is the difference between a process and an application. In Android these are not tightly coupled entities: applications may seem present to the user without an actual process currently running the app; multiple applications may share processes, or one application may make use of multiple processes depending on its needs; the process(es) of an application may be kept around by Android even when that application is not actively doing something.

The fact that you can see an application's process "running" does not mean the application is running or doing anything. It may simply be there because Android needed it at some point, and has decided that it would be best to keep it around in case it needs it again. Likewise, you may leave an application for a little bit and return to it from where you left off, and during that time Android may have needed to get rid of the process for other things.

A key to how Android handles applications in this way is that processes don't shut down cleanly. When the user leaves an application, its process is kept around in the background, allowing it to continue working (for example downloading web pages) if needed, and come immediately to the foreground if the user returns to it. If a device never runs out of memory, then Android will keep all of these processes around, truly leaving all applications "running" all of the time.

Of course, there is a limited amount of memory, and to accommodate this Android must decide when to get rid of processes that are not needed. This leads to Android's process lifecycle, the rules it uses to decide how important each process is and thus the next one that should be dropped. These rules are based on both how important a process is for the user's current experience, as well as how long it has been since the process was last needed by the user.

Once Android determines that it needs to remove a process, it does this brutally, simply force-killing it. The kernel can then immediately reclaim all resources needed by the process, without relying on that application being well written and responsive to a polite request to exit. Allowing the kernel to immediately reclaim application resources makes it a lot easier to avoid serious out of memory situations.

If a user later returns to an application that's been killed, Android needs a way to re-launch it in the same state as it was last seen, to preserve the "all applications are running all of the time" experience. This is done by keeping track of the parts of the application the user is aware of (the Activities), and re-starting them with information about the last state they were seen in. This last state is generated each time the user leaves that part of the application, not when it is killed, so that the kernel can later freely kill it without depending on the application to respond correctly at that point.

In some ways, Android's process management can be seen as a form of swap space: application processes represent a certain amount of in-use memory; when memory is low, some processes can be killed (swapped out); when those processes are needed again, they can be re-started from their last saved state (swapped in).

Here is another article talking about how Task killers will drain your battery.

Do not use Automatic Task Killing Software
To make a long story short, using auto-task killers can cause: excessive battery drain (as if the phone doesnxe2x80x99t drain a battery quick enough already), the phone to overheat often and programs shutting down (crashing) randomly xe2x80x93 programs you actually want to use. Stay away from these!

One thing that you could do if you are really set on "stopping maps" until you want to use it is use the Freeze option in titanium backup. This will essentially remove the application from the device and none of the services associated with it will ever start until you un-freeze it.

 
 
         
         
5
 
vote
vote
最佳答案
 

从提及钛备份时,我假设您的设备已植根。所以我的绝对推荐在这里是 autorun manager (是的,您需要亲第二是的,这是值得的)。安装了,打开应用程序,使用"高级模式" ,查找要修改的应用程序(在您的情况下:谷歌地图)。扩展它。 ARM将向您展示其所有侦听器 - 禁用它们。

就是这样。除非你明确开始它,否则没有什么也在唤醒它。但是:在开始之前,您可能需要再次启用这些侦听器,或者您可能会遇到奇怪的副作用(我已经)。在另一边,至少这不需要重启。

对于技术详细信息,您可能需要用问题如何使用应用程序或直接进入 AOS开发人员手册的意图部分。

 

From your mentioning of Titanium Backup I assume your device is rooted. So my absolute recommendation here is AutoRun Manager (and yes, you will need the Pro -- second yes, it's worth it). Having that installed, open the app, use the "advanced mode", look for the app you want to modify (in your case: Google Maps). Expand it. ARM will show you all its listeners -- disable them.

That's it. Nothing is waking it up anymore unless you explicitly start it. BUT: Before you start it, you may need to enable those listeners again, or you may experience strange side effects (I did). On the other side, at least this does not require a reboot.

For technical details, you might want to crosscheck with the question How can I manage intent associations with apps, or directly dive into the Intents section of the AOSP developer manuals.

 
 
11
 
vote

您是否考虑过未安装和重新安装地图作为可能的解决方案?

  1. 首先,通过删除 /system/app/Maps.apk 文件:

    ,通过删除预加载的地图
      su   rm /system/app/Maps.apk   

    更新系统应用程序后,它在/ system / app文件夹中无用,可以安全删除。

  2. 然后

    然后将当前地图版本复制到SD卡:

      cp /data/app/com.google.android.apps.maps*.apk /sdcard/   
  3. 现在卸载地图应用程序:

      pm uninstall -k com.google.android.apps.maps   

    "-k" 交换机可在重新安装应用程序时保留设置。

  4. 现在让映射回来只需从备份重新安装它:

      pm install -r /sdcard/com.google.android.apps.maps*.apk   

您可以通过 gscript 自动化这些步骤,允许您为脚本创建快捷方式。因此,只需创建一个名为"禁用映射" 的脚本,使用步骤#3的命令,另一个名为"启用映射" 的命令,其中来自步骤#4的命令(检查"需要su?" )。

现在您可以通过使用Android的正常"添加快捷方式" 方法(GScript将是其中的选项之一,从您创建的脚本添加2个GScript快捷方式。)

此方法的唯一缺点是您很可能在卸载它时从主屏幕中丢失Maps快捷方式(和/或窗口小部件),要求您在重新安装后重新添加它。当然,您仍然能够从App抽屉启动地图。

 

Have you thought about un-installing and re-installing Maps as a possible solution?

  1. First, get rid of the pre-loaded Maps by deleting the /system/app/Maps.apk file:

    su   rm /system/app/Maps.apk 

    Once a system app is updated, it's useless in the /system/app folder and can be safely deleted.

  2. Then copy the current Maps version to your SD Card:

    cp /data/app/com.google.android.apps.maps*.apk /sdcard/ 
  3. Now uninstall the Maps app:

    pm uninstall -k com.google.android.apps.maps 

    The "-k" switch keeps the settings for when you re-install the app.

  4. Now to get Maps back simply re-install it from backup:

    pm install -r /sdcard/com.google.android.apps.maps*.apk 

You can automate these steps via GScript, which allows you to create shortcuts to scripts. So just create one script named "Disable Maps" with the command from step #3, and another one named "Enable Maps" with command from step #4 (check "Needs SU?" for both).

Now you can add 2 GScript shortcuts to your home screen from the scripts you created by using Android's normal "Add Shortcut" method (GScript will be one of the options there.)

The only drawback of this method is that you will most likely lose the Maps shortcut (and/or widget) from your home screen when you uninstall it, requiring you to re-add it after re-installation. You of course will still be able to launch Maps from the app drawer.

 
 
       
       
2
 
vote

从Android 4.0冰淇淋三明治,您可以简单地禁用系统设置中的谷歌地图。如果你仍然陷入困境,这将不会帮助你,但其他人可能会从中得到一些好处。

 

Beginning with Android 4.0 Ice Cream Sandwich, you can simply disable Google Maps in the system settings. This won't help you if you're still stuck on Froyo, but others may get some benefit from it.

 
 
   
   
1
 
vote

我建议使用钛备份的冻结功能主页 市场链接。我相信你必须注册这个应用程序(6.58美元)才能使用该功能,但我向您保证,如果您想破解手机,这是值得的。支付应用程序的另一个主要原因(除了支持开发人员写作一块免费软件之外)将能够进行您备份的应用程序和数据的批量安装(即备份)。否则,您必须通过标准应用程序安装对话框。

从网站有关冻结:

app freezer可以禁用一个应用程序(并使它是不可见的),而不会未安装它

或您实际上可以卸载并重新安装。你可能会发现有理由冻结,我不知道。

 

I suggest using the Freeze feature of Titanium backup homepage market link. I believe you have to register the app ($6.58) in order to use the feature, but I assure you, it's worth the price if you like to hack your phone. The other main reason to pay for the app (other than to support the developer for writing a fine piece of free software) is to be able to do batch installs (i.e. restoring from backup) of apps and data which you have backed up. Otherwise you have to get through the standard app install dialogs.

From the website about freeze:

App freezer can disable an app (and make it invisible) without un-installing it

Or you can actually do an uninstall and reinstall. You might find there are reasons to do that over freezing, I don't know.

 
 
 
 
0
 
vote

如果您的手机有选择 Settings > Applications > Development > Stop app via long-press ,您可以随时关闭Google地图,然后此过程也会被杀死,直到您再次打开应用程序。

 

If your phone has the option Settings > Applications > Development > Stop app via long-press, you can always close the Google Maps this way, then this process get killed as well until you open the app again.

 
 
-1
 
vote

root手机然后使用Google Play从AutoStarts应用程序禁用触发映射的所有事件。手动启动时它会罚款,但在杀死它时会保持过去。禁用其他您不需要在启动事件文件夹之后所需的任何其他内存消耗。

 

Root your phone then use the AutoStarts app from Google Play to disable all the events that trigger Maps. It will run fine when manually started but will stay gone when you kill it. Disable anything else you don't need in the After Startup event folder to further reduce memory consumption.

 
 
 
 

相关问题

24  有没有办法永久关闭Google地图,直到需要?  ( Is there a way to permanently turn off google maps until needed ) 
谷歌地图似乎对它注册了疯狂的意图,以及其他开始的方式。 因为这是一个漂亮的资源饥饿的应用程序(尤其是记忆力),我非常希望它永久性未运行/直到我实际需要它。但是,Android一直在一直开始 - 例如,当连接状态发生变化时(对于我频繁地发生在室内),或GPS /网络位置发生变化。 是否有一些方法可以确保Google地图...

2  启动应用程序(即使是SD卡应用程序)  ( Launch app on start even sd card apps ) 
我很确定(尽管没有见过它们),当你打开手机时,有关运行一些应用程序的问题。但我想要一个更复杂的东西。我有一些应用程序在开始时运行。其中一些没有遇到麻烦,因为它们安装在手机中,但其余的安装在我的SD卡中。众所周知(我认为,启动Android后,我认为正常)需要几秒钟即可加载SD卡中保存的所有信息。在Android完成从...

1  如何在初创版中运行一个应用程序  ( How to run an app on startup in background ) 
如何在背景中运行一个应用程序?例如GlassWire,卡巴斯基在启动中运行,以及在通知栏托盘中的顶部显示。我想在启动时在背景中运行GOM音频;自动出现在托盘中。 ...

0  应用程序未启动设备启动  ( App not starting on device boot ) 
我正在使用应该在设备上自动启动的自动化应用程序(重新)启动。但它没有发生。我检查了所有权限,并授予一切。我的设备是沃达丰智能E9。同一应用程序在Optus手机中完美地工作。 我使用检查了沃达丰智能E9的日志 adb logcat -e com.demo.example 并找到以下行: 06-11 11:...

45  如何防止应用程序在启动时运行? [复制]  ( How can i prevent applications from running on startup ) 
这个问题已经在这里有一个答案: 关闭 8年前。 可能的重复: 如何停止运行的应用程序和服务? 我已经安装了一些我最喜欢的应用程序,除了他们所有人都决定他们太重要了而不是自动启动。他们都不是在...

8  有没有办法让Facebook仅在我想要的时候运行?  ( Is there any way to let facebook run only when i want ) 
有没有办法让Facebook应用程序仅在我想使用它时运行,并且当我不需要它时真的关闭它? 我已经用autoStarts禁用了它,移动到SD,但它仍在运行24/7。 我不想出现在Facebook聊天中,也不想浪费30MB的RAM,当然,主屏幕上没有FB小部件 ...

8  为什么某些应用程序即使在我不使用它们时也会运行?  ( Why do certain apps run even when i dont use them ) 
我发现某些应用程序(例如,亚马逊MP3和股票)偶尔会在后台运行,即使我从未打开过他们也是如此。为什么是这样?这是不可取的 - 那些CPU周期是我的,而不是他们的! ...

0  最好阻止AutoStart应用程序,或让他们在启动时运行?  ( Best to block autostart apps or let them run at boot time ) 
当Android仍然是一个婴儿绿色机器人时,我会通过所有用户安装的应用程序(不是系统应用程序),并在大多数大部分中关闭自动启动权限。这将使Android设备启动得更快并以更具可用内存开头。 然后我开始奇怪:如果其中一些应用程序实际上在手机开始时做出什么重要的事情怎么办?也许他们正在清理他们的临时文件,压缩数据库,排序...

2  Android 2.2 - 如何查看在启动时运行的应用程序[复制]  ( Android 2 2 how to see applications that run at start up ) 
这个问题已经在这里有答案: 关闭 10年前。 可能的重复: 如何阻止应用程序在启动时运行? 你好! 是否有可能看到在启动时运行的应用程序? 例如,雅虎的白痴制作了Android Messen...

5  启动Services [重复]  ( Start services at boot ) 
这个问题已经在这里有一个答案: 打开启动/启动后的应用程序 (1答) 关闭...




© 2022 it.wenda123.org All Rights Reserved. 问答之家 版权所有