Using radio buttons to select mp3 file to play - android

Im not necessarily asking for code but more the concept of how to achieve the following.
Im creating a bird-song app where I have a single-button that needs to play two different mp3 files as the user selects one or the other. My hope is to have the single 'play' button and then a radio button for selecting either mp3_A or mp3_B to play.
How would I go about achieving that?
THANKS!

Please try to google keywords if you are really need something most likely someone has already have tutorials on it.
Here is something off the first type on google search: site.
Oh completely forgot just use the basics for mediaplayer class like stop and open whenever a radiobutton is clicked that should solve this request of yours.

Thanks guys. This topic describes a great fix!
http://blog.nelsondev.net/?p=385

Related

android. One activity to rule them all :)

This is more of a curiosity than anything else but it would be good to get some feedback from everyone on possible problems and solutions etc.
Is it possible to use one "host" activity and use that activity to display 3-4 different activities?
I already use tab host in my app and this doesn't seem to fit my needs in regard to the menu idea, ill explain what I'm trying to do as it may help.
Im trying to find a nice clean solution to playing background music, but this could be applied to other functions as well, but essentially, after the splash screen i would like a "host" activity to load first and in that activity, load up a menu activity, when the use presses a button the menu activity, i would like the next activity to load up still inside the "host" activity.
I'm hoping this would make playing music etc as clean as possible and with as little extra coding as possible.
Is this idea possible? would it be beneficial? what would be the best way to accomplish this?
Like i said this is more of a curiousity than a "gimme code to do it", I can work that out once i know the direction to head in & if its possible, I mainly want this for b/g music at the moment but im sure this could be applied other functions.
Thanks for looking, reading giving your thoughts :)
phil

Android: How to implement simple "rate it" preferences button?

I've googled and searched for an answer to my question but all I can find is people asking about rating systems that pop up a dialogue after a number of launches.
My application is for a live wallpaper so I expect most people to launch and set it once.
I just want a preference button that takes users as directly as possible to the app rating screen.
Can anyone suggest the best way to accomplish this? Thank you!
Here is code you are looking for
https://github.com/codechimp-org/AppRater
Add this library in your project and you should be set.

Button Click - Play a Sound or Nav to a Page?

First time poster. Im totally new to Android but I have manged to dreate a UI with two buttons. Im now attempting to find out how to hook up Button 1 to a WAV file and Button 2 to go to a second page.
Could any body please provide or link to an "easy" explanation on how to play a WAV file when clicking a button and how to open a new page when clicking the second button?
Ive found examples on the web (for the sound) but they fail to describe the full content needed such as other system "coms" etc.
Thanks all.
You've asked a general question, so the best I can do is give you a general response. For the playing sound, I'd look at the documentation that android provides for the MediaPlayer class. For launching another page, that's as simple as creating a new Intent with the activity you want to open. You'd engage both of these things by setting an OnClickListener for your buttons.

How do I put a listView inside a regular Activity?

I want to create an audio app to promote music. I want to have a regular Activity that has a listView and then a container or two to display standard information about the Artist. Music files will be inside the ListVIew with a button to play and stop the selected song. So to sum this up how should go about putting a list with buttons inside an Activity with other container? Hopefully this makes sense.
Thanks.
You should really check out this great Notepad tutorial. You create a basic Notepad, which uses a listview, and a database. If you just starting out I can tell you from experience, these tutorials are the best way to learn. There are tons of them out there :).
EDIT: While I could just give you the code to do what you want, you would learn nothing in the process :).

share feature of menu in android application

i asked so many question regarding my title but i could not get my proper answer till yet.I need to implement androd's menu feature in my application ie when we goes to gallery in android phone, when we press menu than it comes with lots of option like share...etc.My question is can i implement same menu feature in my application? It is possible or not?
Thanks
To implement a "Share" feature, all you need to do is use createChooser() and an ACTION_SEND Intent.
Here is a blog post covering the technique.
If I am understanding your question you want to know if you can duplicate the feature of tapping on the menu button on the phone and having it pull up an options menu that you can then share via, gmail or some other posting medium?
If this is correct then I would have to say I would assume that you could duplicate this feature.
In short YES!
If you are wondering how you are to do this then I would start at here http://developer.android.com/guide/topics/ui/menus.html
Droidnova .com (I posted it like this because as a new user I can only post one link) also has a good little how to on menu's.
I would also like to add that this is my first time posting on stackoverflow so please let me know if this was a good post or what I should do next time.
Thanks,
Bactos

Categories

Resources