I need help to make an apk that I open a website

Monkey Forums/Monkey Beginners/I need help to make an apk that I open a website

monoloc(Posted 2014) [#1]
I need help to make an apk that I open a website in android default browser,
is very simple,
just now I have put myself to program
and install all sdks, and I was able to compile apk, sending the tablet
or cell, rather the applications.
but certainly donot like I can do.

passed me a link to a code they use the android sdk
but my only experience is with blitz and other basics,
java etc. zero. I'm not sure if you can implement or
if there is a command that can serve me, for that

String url = "http://www.YOUR-URL.com";
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);

Obviously that did not run in the monkey..
some expert who can help me? :)


therevills(Posted 2014) [#2]
Have you tried the OpenURL command?

http://www.monkeycoder.co.nz/docs/html/Modules_mojo.app.html#OpenUrl


monoloc(Posted 2014) [#3]
yes work! :3 thanks! ,,
will modify some lines, because of principle gave me error
but then walked

Now I have to do as I add some nice background image
:)

Import mojo

Class MyApp Extends App

Method OnCreate()

SetUpdateRate 60

End

Method OnUpdate()

If MouseHit(0)
If MouseY() >0
OpenUrl "http://www.web.com"
Else
OpenUrl "mailto:admin@..."
Endif
Endif
End

Method OnRender()

Cls
DrawText "web.COM!, Clik to continue",DeviceWidth/2,DeviceHeight/2,.5,.5
End


End

Function Main()

New MyApp

End


Gerry Quinn(Posted 2014) [#4]
Or diddy.externfunctions.LaunchNativeBrowser() is also available.


therevills(Posted 2014) [#5]
I've actually been meaning to remove that function from Diddy since Monkey now has the OpenURL command... It'll end up as a wrapper for OpenURL.


golomp(Posted 2014) [#6]
Thank you a lot i was searching how to do that.


Gerry Quinn(Posted 2014) [#7]
Heh, I keep an old version of diddy.externfunctions which I have added to. A lot of stuff has become unnecessary now, but I've never been one to update working libraries...