Limitations of android

早过忘川 提交于 2019-12-06 07:18:42

To try and answer your questions;

1) Registering a BroadcastReceiver doesn't really translate into having your app running in the background 24/7. It's rather like you register your app in the system, which will boot and notify it when needed. You don't have to be afraid of using up battery by having these Receivers, as long as you don't do battery-intensive things on very regular broadcasts.

2) There is not really any limit, although it should make sense to you that sending 100mb, possibly over someone's 3G connection, wouldn't make anyone happy. If a previous app of you crashed while trying to send 10MB, you probably did it the wrong way like making it a base64 string. I'm not sure to what kind of server you're going to upload it, but you want to find some code sample that buffers the image up to the server in small chunks. Also keep in mind that on a phone, you can never be sure of a stable connection.

1.) There is effectively this kind of mechanism in Android development which is bulked in and already done for you :) This mechanism is called Intent and you just have to declare it on your application, the system take care of calling your registered component for you

2.) No limitation here, but you have to be carefull to send it with a background thread or a service (to not block the UI thread) and handle connection timeout etc

And yeah efficient works doesn't need to reinvent the wheel !

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!