Is it possible to share my video or my photo from my application on the web in android?If possible how to do this? I made a application and now i want to share some my feature on the web so how i can do it?
Thanks
Depending on what exactly you mean, it’s possible that this functionality is already built in. Using the ACTION_SEND intent allows the system to coordinate activities to share arbitrary kinds of data. Applications exist that can send images and videos to Twitter, YouTube, Picasa, MMS, Bluetooth, etc.
Something like this (untested) will inform the system that you have an image to share:
Intent msg = new Intent(Intent.ACTION_SEND);
msg.setType("image/jpeg");
msg.putExtra(Intent.EXTRA_STREAM, Uri.parse("file:///sdcard/foo.jpg"));
startActivity(Intent.createChooser(msg, "Share image"));
Now, if you want your application to send images specifically to your web service, you can still use this send intent, but also include an activity that can handle this sort of request. If you still use the intent chooser, the user will have the advantage of being able to send their images and videos to other places besides your web service, and your application will feel like an integrated Android app. On the other hand, bypassing the intent chooser and just uploading it directly makes your app feel more streamlined but less flexible.
The Android API includes the org.apache.http framework for talking to web services.
#rbads, this is an old question so i don't know if it's still pertinent, but you can also share with Socialize -- www.GetSocialize.com. We use the concept of "entities" and have likes, comments & sharing around each entity (entity = unique piece of content in your app).
Related
I have ShareActionProvider in my Application. it shares a photo I uploaded with a text I insert. When share is done, I want to show a popup message/dialog with a button OK, clicking on which I should return to my application. The question is: in my application how can I know if share is complete or no ? For example, if I share the photo and text in instagram, how can I know that post is already done.
in my application how can I know if share is complete or no ? For example, if I share the photo and text in instagram, how can I know that post is already done.
That is not possible for ACTION_SEND. What the user does with the shared content in the other app is between the user and the developers of the other app. The user might do something immediately, later, or never. The app might do something immediately or later (e.g., upload the content as part of a periodic sync operation with a server). There is no protocol for the receiving app to tell you that sharing is "done".
Specific apps may offer specific APIs, beyond ACTION_SEND, that offer capabilities in this area, but those will be unique to those apps.
Use a Toast like this: Toast.make(context "Uploaded", Toast.LENGTH_SHORT).show();
Toast is just tiny little "popup"
Applications of these two ideas could include enabling the player to see his or her progress in earlier games within the latest sequel, being able to keep the same character/progress across games, etc. etc.
While the best solution is likely having the player create an account they use across games, I'd like to avoid that if I can (both because players are already logging into Google Play Games, and because I currently do not have access to server infrastructure to handle doing that). Is there any other official/popular mechanism for passing data between games, or is the account route the best bet?
I believe that this is what you are looking for, Interacting with Other Apps especially the Sharing Simple Data and Sharing File section. You may also refer to this documentation for Receiving Simple Data from Other Apps which suggests that you will need an ACTION_SEND intent filter.
Update Your Manifest
Intent filters inform the system what intents an application component is willing to accept. Similar to how you constructed an intent with action ACTION_SEND in the Sending Simple Data to Other Apps lesson, you create intent filters in order to be able to receive intents with this action. You define an intent filter in your manifest, using the <intent-filter> element.
Handle the Incoming Content
To handle the content delivered by an Intent, start by calling getIntent() to get Intent object. Once you have the object, you can examine its contents to determine what to do next. Keep in mind that if this activity can be started from other parts of the system, such as the launcher, then you will need to take this into consideration when examining the intent.
I think this would be a good place to start on how to pass data from one app to another. You will also need to make changes in your current implementation both in your existingt and new app for this to be possible.
The other solution to this is to have all the games share a common Play Game Console configuration. You can have multiple packageIds point to the same appId, so they see the same list of achievements, leaderboards, etc.
Depending on your specific requirements, you could simply change the descriptions of the items to describe which game they are for, or implement custom UIs to display the lists.
I have been asked to add a "share" method to one of my Android applications which allows users to share by 1) Facebook 2) SMS and 3) Email
While researching, I have found that to allow users to select from "messaging" applications, I need to create the following Intent:
Intent messageIntent = new Intent(Intent.ACTION_SEND);
messageIntent.putExtra(Intent.EXTRA_SUBJECT, title);
messageIntent.putExtra(Intent.EXTRA_TEXT, content);
messageIntent.setType("vnd.android-dir/mms-sms");
// title and content set elsewhere...
This kind of works, although I am also given email clients in my list...
My Questions:
Is there a list somewhere of the Android specific MIME types that are available for us to use? The "vnd.android-dir/mms-sms" seemed pulled out of thin air to me from the example I found.
Is there the proper way to get ONLY messaging clients (ie. not mail clients) - or is that pretty much impossible to do in Android.
Disclaimer: The above code snippet was found from another SO post. Perhaps it is just me failing at Google - but I cannot seem to find any documentation on the legit Android developer site which listed out that this was the correct way to do this, or what my options are.
I have been asked to add a "share" method to one of my Android applications which allows users to share by 1) Facebook 2) SMS and 3) Email
Please allow the users to share how the users want, which may or may not be via those means.
I have found that to allow users to select from "messaging" applications, I need to create the following Intent
No, that allows users to share via any application that happens to support that undocumented and unsupported MIME type. Not every "messaging" application will necessarily support that MIME type, and applications that are not "messaging" applications are welcome to support that MIME type.
Is there a list somewhere of the Android specific MIME types that are available for us to use?
Not really, as generally they are undocumented or under-documented (e.g., the constant shows up somewhere without explanation).
The "vnd.android-dir/mms-sms" seemed pulled out of thin air to me from the example I found.
It probably came from the Android source code.
Is there the proper way to get ONLY messaging clients (ie. not mail clients) - or is that pretty much impossible to do in Android.
There are ~7 billion people on the planet. Each of them is welcome to have a different idea of what a "messaging client" is, what a "mail client" is, etc. Those are descriptive marketing terms, not technical definitions.
ACTION_SEND is for sharing content via MIME type. Any application can offer to support ACTION_SEND for any given MIME type, as the developers of any application can write what they want. Whether any given application is a "messaging client", "mail client", or something else is up to the end user. You have no means of reading the minds of users, nor do you have any legal means to prevent other programmers from writing what they want.
Now, there are various script-kiddie hacks for limiting the share list to certain apps, by application ID (a.k.a., package name). However, while there is only one Facebook (though I seem to recall they have a few apps), there are many SMS and email apps, and it would be difficult, if not impossible, for you to come up with a list of all of them, let alone maintain that list over time.
My strong recommendation is to format your content usefully, and allow the users to share that content using the apps that they wish.
I want to launch gallery to pick an image in my google glass app. for android mobile it is straight
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("image/*");
startActivityForResult(intent, REQ_SELECT_FILE);
when i am running same code in glass, it fails with error
07-29 16:12:45.941: E/AndroidRuntime(15847):
android.content.ActivityNotFoundException: No Activity found to handle
Intent { act=android.intent.action.GET_CONTENT }
Seems related Component is not part of gdk. then what should be the alternative. i sure they must provided some other way to use images saved on device. any pointer around that wd be appreciated.
There is no gallery on glass to select images, documents, or anything. (technically this intent doesn't exist on glass) Glass is a glance based system so they don't include systems that are in android that cause the user to interact with the device for extended periods of time.
If you want to select an image you are going to have to build it yourself, but chances are it probably shouldn't be in a glass app to begin with so Google will probably request you to remove it anyway.
Concur with what #w9jds has said. It sounds like you're thinking about your app in a fairly non-glass-like way. If you re-think it, it might still do what you want, work better on Glass, and be a better user experience.
If you're looking at sharing or sending a picture, for example, it might make sense to leverage the Contacts that are provided by the Mirror API. People can take a picture and then share it to your service or to contacts that your service has provided to Glass. It takes care of making sure that the upload succeeds so you don't need to.
Even if you're not using this for some reason, it is a model that you should likely adopt. Your app should guarantee the upload succeeds (eventually) so the user should never have to retry it. You can implement the horizontal scrolling to select a picture that your app generated. There is currently no pre-provided tool to do this in a GDK app.
Look at and use the existing Glassware as a model. They were designed the way they were for a reason.
I am interested in opening the Google Navigator app from inside an application I am writing. I want to be able to spawn it at a given time and pass specific data into it.
Can anyone think of a good way for me to do this? What permissions do I need, etc? Thank you very much.
You are looking for intents. These are messages you throw up to the system that allow the appropriate action to be taken, such as opening another application.
Here is a guide to using Intents and Intent Filters.
In particular, here is a page that discusses the intents you should use for Google's applications, including Google Maps.
Also, see here for a similar question asked on Google's forum.
A sample of example code that works is as follows:
Intent i = new Intent(Intent.ACTION_VIEW,
Uri.parse("google.navigation:q=New+York+NY));
startActivity(i);