-2

I really need help with an android application that I am trying to make for my personal use.

I want to use adobe flash pro. I can make the GUI, but I just need the code that makes it all work.

This is my intention: When I click on a button, it opens another app (vplayer or MX Player) and then the player opens an RTMP stream.

basically, i want my app to open a URL with another app.

Please help me with this.

Thank you.

  • What exactly you are intending to do? Are you trying to open player while you click on an icon in your app? – nidhi Aug 08 '13 at 05:31

1 Answers1

0

You can use the below code:

Assumptions:

  • hope you are looking for code in java.
  • You have an ImageButton on your screen whose id is imageButton1
  • You have an URL ready before calling this code.

Code Explanation:

A reference to the ImageButton is created and an on click listener is set for it. we use Intent and set the URL as its data. now, Onclick will fire an Intent which will be handled by any app on the android system capable of handling that data.

ImageButton my_icon= (ImageButton) findViewById(R.id.imageButton1);

    my_icon.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {

            Intent intent = new Intent(Intent.ACTION_VIEW);
            intent.setData(Uri.parse(url));
            startActivity(intent);

        }
    });
SKK
  • 5,261
  • 3
  • 27
  • 39
  • May I ask if this only works in java? Because I want my app to look a certain way and have as less code as possible. I am not sure if Flash CS6 (Air for Android) uses java code. Thank You for replying. – user2663159 Aug 08 '13 at 05:53
  • No, it doesn't use java code. And Sorry i can't help you with Flash CS6. – SKK Aug 08 '13 at 07:11
  • Ok. is it as easy to create a gui in java like it is on Flash CS6? – user2663159 Aug 08 '13 at 07:16
  • It depends on what you intend to do. since its for your personal use does it matter to have a nice fancy UI?. anyhow follow some tutorials to familiarize with android app development. following videos can be used to understand the code i have written. http://www.youtube.com/watch?v=rqZnn5cf2As , http://www.youtube.com/watch?v=86daCHoDiOk – SKK Aug 08 '13 at 07:24