nimbosa / posit-mobile

Automatically exported from code.google.com/p/posit-mobile
GNU Lesser General Public License v2.1
0 stars 0 forks source link

Extend Twitter Functionality #299

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
This is a proof of concepts of a way to incorporate images to the twitter 
messages as well. 

There is a third party company that allows provides an interface to upload 
images and associates it with Tweet messages. I have not made a patch, but just 
provided updated version of the TwitFindsActivity.java and the third party 
library it references. (Where the third party library would also need to be 
linked through eclipse.) 

Basically, I provide a static function called 
  * String tweetBitmap(String filename, byte[] bitmapImage, SharedPreferences prefs)
The expectation is that the User is logged into Twitter already. This is 
checked with the SharedPreferences. If successful, the image will be uploaded 
with the specified filename and associated with the Twitter account. The 
function returns a String URL of the image. This can be incorporated to the 
Find's custom Tweet Message string. 

Testing
This is perhaps, a little difficult to test given the current state of the 
Camera features. I have tested using Gordon's camera activity. Where in 
FindActivity.java, displayContentInView(...) I inserted code while the image is 
read from file and converted into "byte[] c". 
  * SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);  
  * String url = TwitFindsActivity.tweetBitmap("Stan Test", c, prefs);
And if the User is logged into Twitter, url should be the url of the uploaded 
image. 

I might be a better idea to incorporate this change after we have some plugins 
incorporate images to the database. So that we can test it within a real find 
plugin scenario. 

Original issue reported on code.google.com by stan.f...@gmail.com on 12 Dec 2011 at 12:08

Attachments:

GoogleCodeExporter commented 8 years ago
Forgot a file. 

Original comment by stan.f...@gmail.com on 12 Dec 2011 at 12:10

Attachments:

GoogleCodeExporter commented 8 years ago
We should discuss this.  Do we really want to tweet images?  And, secondly, we 
need to make sure there are no license conflicts when incorporated 3rd party 
code.

Original comment by ram8...@gmail.com on 13 Dec 2011 at 2:16