Android -- How does Google+ instant upload work? - java

I was playing around with the new Google+ application on the Android and I had a technical question that I couldn't seem to find online. How does the instant upload hook into the native camera application?
I can turn on a feature in the Google+ application and any pictures that I take with the native camera app are automatically uploaded to a private album on Google+. And this seems to be true whether the Google+ application is currently running or not. Is there any type of hook that I can register a callback event for in my application to access "just-taken" pictures for some post-processing goodness? I'd really like to tap into this functionality for an application that I am currently writing.
Any insight or hints in the right direction are greatly appreciated! Thanks!

Not entirely sure exactly how Google+ does it, but one way that would work is to use the ContentObserver interface: grab the MediaStore.Images.Media ContentProvider and attach a ContentObserver to it. Anytime a camera image is added, you'll get a notification and you can process it accordingly (including uploading).
Same technique would work for just about any ContentProvider that properly handles ContentObservers (which I'm assuming is all ContentProviders, but you never can tell).

Thanks to Femi's answer in this post, I was able to take what he said and figure out how to emulate Google+'s Instant Upload feature. I wrote a tutorial about it here:
http://www.jessechen.net/blog/how-does-google-plus-instant-upload-work/

Related

How to record video in background when having video calling in application

I am developing an application that will be use to record video in background once the video calling starts.I googled about it but didn't get any solution. Many articles say that it is not possible.
Please let me know the way to implement the functionality
What you can do is that you can simply record the screen of the phone. There are several libraries available for implementing that. You can trigger or alert the library to start recording the screen once the video call starts.

How to get Image Uri which is displayed on full screen?

Okay so I searched a lot but couldn't find any solution for my problem.
I am trying to develop an android application which will have some background running service. Suppose I opened Gallery and I am seeing some photo and I want my service to store that image's Uri. The problem is how to get image Uri which is being displayed on the screen. Also I want to extend it to Gallery Grid View where I can select multiple photos and ask my service to store their Uris.
I tried using reflection to get object of ViewImage.java class and invoke getCurrentUri() method. But I am getting ClassNotFoundException.
I am looking for a solution even if it requires my app to be system app, rooted device or using reflection to access android gallery code.
I want to get the Uris for Currently played videos or currently selected videos and music files along with documents like pdf, word.
The problem is how to get image Uri which is being displayed on the screen.
Fortunately, this is not possible, for blindingly obvious privacy and security reasons. The interaction between the image-viewing app and the user is between the app and the user; others cannot spy on that information, barring security flaws in the app.
I want to get the Uris for Currently played videos or currently selected videos and music files along with documents like pdf, word.
Fortunately, that too is not possible, barring security flaws.
I tried using reflection to get object of ViewImage.java class and invoke getCurrentUri() method. But I am getting ClassNotFoundException.
Other apps are running in other processes; you cannot use reflection to access them.
I am looking for a solution even if it requires my app to be system app, rooted device or using reflection to access android gallery code.
A custom ROM could probably spy on the communications enough to achieve your ends.

Phone gap camera - is there a more powerful option?

I'm looking to build a companion photo capture app for my photo capture website. I was planning to do this with phone gap.
Upon triggering the camera I want to grab a frame (a still, really) up to five times a second and send it to the server (barring any surprises, The sending part should already be dealt with in code I have). I suppose the realtime video from the camera itself should be displayed to the user as well, though I could just use the stop motion frames for that part.
Unfortunately, according to the phone gap docs, one can only launch the phone's cam app, manually take a picture, then return the user to the app.
I am looking into plugins, but I don't see any massive phonegap plugin repository out there, so I am not sure where to begin. I am just rambling now, so here is a list of bulleted questions:
Is there a plugin out there that does something like this already?
Is there a giant repository of phone gap plugins that I am too foolish to find?
If I try to roll my own java plugin (this is for an android app), what am I really getting myself into? Will I need to know enough to just make the damned thing native? I am pretty exclusively in the JS world at the moment, and am trying to get this out the door asap.
Am I missing something and there is a way to to this with vanilla phone gap?
Any other suggestions?
Thanks!
The phonegap plugins are here:
https://github.com/phonegap/phonegap-plugins

Get android notification from app?

I was thinking to build up an app to manage the notifications. I gave a look to the Notification Manager but i didn't find anything that could help me. I'd like to get all the notifications (that are in the notification bar). Have you got any idea? Thanks, regards.
I don't believe there's any possibility to do such thing using the public API. There are strict restrictions to what an app can access, for obvious security reasons. Each app is handled as a different user by the OS, so it has access only to public data and to the data owned by that app.
If you need this for a private project, you may consider modifying the android source code. I can't give you many details on how to do it, but I would start by looking at com.android.server.NotificationManagerService (source code here).

Possible to 'layer' Android applications?

I know this in general is beyond the scope of SO, but I am looking for some basic yes/no info to see if it is even feasible to proceed... I am thinking about building and Android 'note-taking/annotation' app that runs 'over' other installed Android apps, such as the web browser for example.
Essentially, while the user is browsing, my app would be running in the bg as a service, and then they could activate it which would then essentially intercept user inputs and translate those on a transparent canvas over the web browser into lines, shapes, etc. The user could then take a screen-cap of their marking with the underlying web page, which would be stored to the sd card.
This is a very good idea and a great question, but sadly, I do not believe it is possible.
The way Android is designed only one Activity can have focus at a time, while a Service could run in the background, the user would not be able to interact with it. The user can only interact with the currently active Activity.
Again, love the idea, but it is sadly not supported.
You might be able to achieve this with the WindowManager service. You can then use that to call addView() with a view of type TYPE_SYSTEM_ALERT, or possibly TYPE_SYSTEM_OVERLAY (but see the notes in the documentation about taking input focus).
I haven't tried it myself, but I've seen several apps (often dictionary apps that translate whatever words you tap on) that do overlays, and they always seem to require the SYSTEM_ALERT_WINDOW permission.

Categories

Resources