Jump to content
Android Forum - A Community For Android Users and Enthusiasts

Simple App


Recommended Posts

Hi guys,

I'm a newbie who doesn't know anything about android apps, but I need help creating a simple application. Here is the image to visualize it.

 

View image: prototype

 

 

I want this to be extracting the information from an .xml file. Something looking like:

 

 

cat, a small domestic animal, cat.png, cat.mp3

dog, a medium domestic animal, dog.png, dog.mp3

cow, a big domestic animal, cow.png, cow.mp3

 

I want the image to be clickable, once clicked an audio will play. The audio and image name will always be similar to the name of the object (cat, will be always cat.mp3) ... I would really appreciate any help I could get.

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...

Easiest way would be to create the first activity for starting and a second one for the animals. You can save the images and audio in your asset folder, and the easiest way would be to assing names like "cat.jpg" and "cat.ogg". Then under values/strings.xml just save all of them in a string with the same name (ie: "cat").

 

Then inflate the image and text. If you want to randomize the animals it may be easier to just save everything with numbers.

 

To play audio you can read about it here: http://developer.and...ediaPlayer.html

 

In the last activity just change the strings using the same xml layout that in the first one.

 

If you want to use a xml for every animal copy all over the same layout for each animal changing the text and image as well as the sound url.

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...