tweet from an app? (or open twitter)

Monkey Targets Forums/Android/tweet from an app? (or open twitter)

sandfella(Posted 2013) [#1]
Hey,

Is there a way to open default twitter app with a text? I'd like to have a button for the user so that he could tweet things like "I just run 133 meters on #angrytrollrun - beat my score".

It would be OK (best actually) if it would simply open your twitter app and you would then need to send the tweet manually.

Any idea how?


AdamRedwoods(Posted 2013) [#2]
so monkey doesn't have such features since it's not cross-platform, but you can enable external code as follows:

for android, UNTESTED!

Edit: updated see link below.

make sure to use the functions together in succession:
SetTwitterName(user_name)
SetTwitterText("This is a test "+other_stuff)
LaunchTwitter()


Hopefully at some point monkey will have a SendHttp command, which will make this easier.


sandfella(Posted 2013) [#3]
Will try this out. Thanks.


sandfella(Posted 2013) [#4]
damned java...
"illegal start of expression
not a statement"


AdamRedwoods(Posted 2013) [#5]
oh right, i forgot the two "//" at the end of LaunchTwitter. modified above, try again.


sandfella(Posted 2013) [#6]



AdamRedwoods(Posted 2013) [#7]
try this, updated above.
try { Activity.startActivity( new Intent...

if this doesn't work then i'll try it on my other computer which has android set up. may also have to set intent permissions in the manifest...


sandfella(Posted 2013) [#8]
We should pair-program a game this way.

Ok, I'll try once more... and then wait :)

update: no luck :) thanks for the persistent help!


AdamRedwoods(Posted 2013) [#9]
works now. moved to here, to include iOS, winphone people.

http://monkeycoder.co.nz/Community/posts.php?topic=5343

We should pair-program a game this way.

hahaha!


sandfella(Posted 2013) [#10]
Nice!


sandfella(Posted 2013) [#11]
...except still no work :)

"C:/Projects/tempmonkey/temp.monkey<32> : Error : Syntax error - expecting declaration.
Abnormal program termination. Exit code: -1"

But maybe I just stop here... :D


AdamRedwoods(Posted 2013) [#12]
updated.
i don't know why some days i make obscenely dumb coding mistakes.


sandfella(Posted 2013) [#13]
My theory is you wanna see how long i keep testing these. ;)

Thanks... will check out.


sandfella(Posted 2013) [#14]
Eh... still no can do. I think this is enough Adam now --> *hides away*! :D


AdamRedwoods(Posted 2013) [#15]
ok, not sure. someone else will have to try.
seems to work here. goes to twitter with the app, and if no app goes to the twitter web intent.