2 Replies Latest reply on May 30, 2012 6:49 AM by Micke@KGK

    Ringtone application, how to (Android)


      Hi, I'll get straight to the point.


      I have 100 soundfiles, mono/mp3, about 30 seconds long each.

      In my application I have a list with 100 selectable names, each one opens up a new view. Still standard.


      Now, inside the view for example numer 45 I want to have two buttons. One "Play/pause" to preview the selected audiotrack and then one "Set as ringtone" which sets the selected audio as the default ringtone.


      I have seen applications out there, lots of them, so I know it's possible, but how do I create this function in my application?



      My code is to put in simple in the DetailsView after having selected for example track 45:


      HomeView > Details (info on name, number, track has been called from an xml-file)



      <?xml version="1.0" encoding="utf-8"?>

      <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"

              xmlns:s="library://ns.adobe.com/flex/spark" title="{data.name}">




                  protected function backButtonClick(event:MouseEvent):void








              <!-- Place non-visual elements (e.g., services, value objects) here -->



              <s:Button label="Back" click="backButtonClick(event)"/>


          <s:Image left="20" top="20" width="125" height="125"/>

          <s:Label x="162" y="20" text="{data.number}"/>

          <s:Label x="162" y="43" text="{data.style}"/>

          <s:Label x="162" y="66" text="{data.length}"/>

          <s:Label x="162" y="89" text="{data.bpm}"/>

          <s:TextArea left="20" right="20" top="250" bottom="20" editable="false" text="{data.bio}"/>

          <s:Button left="20" top="170" label="Play/Pause"/>

          <s:Button x="162" y="170" label="Set as ringtone"/>



      So you see I have a button. Now, what do I need to do to assign this button to set the selected audiofile as the default ringtone?


      Thank you in advance for alla help and suggestions.

      I use Flash Builder 4.6 and I am targeting Android.