简体   繁体   English

Android-是否可以使一个应用程序更改为另一个应用程序? 如果可以,怎么办?

[英]Android- Is it possible to make an app change another app? If so how?

I'm developing a photo manipulation app and am wondering if there is a way to have something come up for my app after the user takes an image of a picture (by somehow changing the camera app). 我正在开发一个照片处理应用程序,想知道在用户拍摄图片图像后(通过更改相机应用程序)我的应用程序是否有办法。 Another example of something like what I want to do would be something like changing the calender app to also put in a location and use GPS to find directions to that location. 另一个类似我想做的事的例子是将日历应用程序更改为也放置在某个位置并使用GPS查找到该位置的方向。 Is there a way to do this? 有没有办法做到这一点? If so how? 如果可以,怎么办?

If you want direction of a location, you need to use Google Maps API (or similar), not GPS. 如果要确定位置的方向,则需要使用Google Maps API(或类似方法),而不要使用GPS。 To put stuff into Google Calendar, look at their API as well. 要将内容放入Google日历,请同时查看其API。

I don't know if you can change the app itself, but you can definitely integrate your application with another android applications. 我不知道您是否可以更改应用程序本身,但是可以将您的应用程序与另一个android应用程序集成。 There are several examples that can show you how to acess the camera app to take a picture and return this picture to your app for manipulation, or accessing a picture from your gallery (take a look in Intent class, and you can use it with startActivityonResult, and on onActivityResult, inside your activity, you manipulate the picture). 有几个示例可以向您展示如何访问相机应用程序拍摄照片并将其返回给应用程序以进行操作,或者从图库中访问照片(在Intent类中进行查看,可以将其与startActivityonResult一起使用,然后在活动内部的onActivityResult上操作图片)。 Hope that helps 希望能有所帮助

As I understand from your question, you want your app to appear when the user takes a photo using the native camera app. 据我对您的问题的理解,您希望您的应用在用户使用本机相机应用拍摄照片时显示。 Although that's possible (not saying it's easy), a better solution would be to launch the camera intent from YOUR app (or display what the camera sees in a SurfaceView), and use it as you wish. 尽管这是可行的(并不是说很简单),但是更好的解决方案是从您的应用程序启动相机意图(或显示相机在SurfaceView中看到的内容),并根据需要使用它。 You wouldn't want to change the default behavior of built-in apps in the system, and users will thank you for not doing so. 您不想更改系统中内置应用程序的默认行为,用户将感谢您不这样做。

There are countless tutorials out there that teaches you how to make use of built-in apps' functionalities for your own. 那里有无数教程,教您如何自己使用内置应用程序的功能。 As an example, here 's an SO thread that teaches how to use the built-in camera to take a picture, and use the resulting data in your app. 作为示例, 这里有一个SO线程,该线程教如何使用内置相机拍照,以及如何在应用程序中使用结果数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM