常规:如何更改Android核心API类? [英] General: Howto change Android core API classes?

查看:122
本文介绍了常规:如何更改Android核心API类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这只是一个一般性问题,仅供我参考.我知道如何创建标准的Android应用程序,但我想知道:人们如何/如何增强Android核心功能并更深入地研究系统?

This is just a general question for my information. I know how to create standard Android apps, but I was wondering: How is it possible/how do people enhance Android core functions and dig deeper into the system?

例如: 假设我想修改 DownloadManager 类,应用.因此,例如,可以修改该类,以便以某种方式更改在通知进度条下的通知栏中显示的下载文本.

For example: Let's assume I want to adapt the DownloadManager class, which is used by many apps. So, for example, one can adapt the class so that the download-text, which is displayed in the Notification bar under the download progress, is somehow changed.

请问以下愚蠢的问题,但我对这些高级主题一无所知,这就是为什么我要在这里;-)

Excuse me the following stupid questions, but I have no idea of these advanced topics, that's why I'm asking here ;-)

  • 可以更改(例如)DownloadManager类,以使其具有扩展功能,然后供第三方应用程序使用,对吧?
  • 然后可以将修补的类放到Play商店中,供其他人下载/扩展其DownloadManager功能吗?
  • 人们需要Root才能安装这样的更改吗?
  • 最重要的是:有人如何更改Android API类?我在这里真的很菜鸟:我不知道从哪里获得源代码,如何用增强的类替换标准,这需要什么,等等.甚至没有关于此类高级主题的教程吗?

请给我一些启发:-)

推荐答案

可以更改(例如)DownloadManager类,以便 它具有扩展的功能,随后将由第三方使用 应用.

is possible to change (for example) the DownloadManager class, so that it has extended functionality which will then be used by 3rd party apps.

是的,当然,Android源代码是在Apache许可下打开的,您可以修改此源代码,并公诸于世.有关DownloadManager类和许多其他类的详细信息,在Android OS Structure中,这些类是在上层编程的,通常完全在Java中编写.

Yes, of course, Android source code is opened under Apache license, you can modify this source code, and public into the world. For some detail about DownloadManager class and many other class, in Android OS Structure, those class is programmed on upper layer, often totally in Java.

然后可以将打补丁的课程放到Play商店中供其他人使用 下载/扩展他们的DownloadManager功能?

Can the patched class then be put in the Play Store for other people to download/extend their DownloadManager functionality?

我不太了解您的问题.在Play商店(和另一个android应用商店)中,人们上传他们的应用(用有趣的话说,上传的源代码已编译),那么如何为用户扩展他们的应用上传源代码?

I don't understand your question so much. In Play Store (and another android app store), people upload their application (in funny sentence, upload the source code has been compiled), so how can you upload a source code for user extends their apps ?

您可以将源代码发布到github或程序员经常会见的其他地方,这样他们就可以查看您的源代码,并经常为您提供宝贵的想法和意见:)

You can public your source code to github, or another place that programmers often meet, so they can view your source code, and often give you valuable ideas and comments :)

人们需要Root才能安装这样的更改吗?

Will people need Root to be able to install such a change?

如果是高级用户,他们可以为其设备安装新的Android操作系统.但是我认为,这个答案远远超出了您的真正需求.

if advanced user, they can install new Android OS for their device. But I think, this answer is further than you really need.

从何处获取源代码,如何用 增强类,它需要什么,等等.甚至还有教程 像这样的高级话题?

Where to get the source-code from, how to replace the standard with the enhanced class, what's needed for that, etc. Is there even a tutorial on advanced topics like this?

在Android SDK文件夹中,有一个名为源"的文件夹,您可以去那里查看许多Android源代码.您可以接受,阅读和修改所需的内容. Android的某些部分不在这里,您应该在Google上搜索它,它很容易在Internet上找到.

In Android SDK folder, there is a folder named "Source", you can go there and see many Android source code. You can take that, read, and modify what you want. some part of Android is not here, you should google for this, it easy to find on internet.

但是您应该记住,当您修改此类或该类别时,该类别不再属于Android OS,您必须将该类别文件作为普通类别导入到您的项目中.

But you should remember, when you modified this class or that class, it not belong to Android OS again, you must import this class file to your project as normal class.

因此,如果您想修改基本的Android API:这些API通常都是用Java编写的,并且您仔细阅读并理解后,可以根据需要修改某些部分,然后将该类导入您的项目中.

So, if you want to modify base Android APIs : those APIs often write all in Java, and you read them and understand carefully, modified some part if you want, and import this class into your project.

最后一句话,为什么要这样做:)因为您可以扩展所需的类,并为此类添加一些其他功能.更容易,更友好.

And last word, why you should do that :) Because you can extends the class you want, and put some additional features for this class. It's easier and nicer.

希望获得帮助:)

这篇关于常规:如何更改Android核心API类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆