Re: [android-developers] newbie needs help - play a sound when app opens

2016-12-01 Thread Steve Gabrilowitz
And in which of the lifecycle methods did you place this code?

On Dec 1, 2016 9:38 AM, "chicago chuck"  wrote:

> Thanks for the reply Steve.
>
> I have the following in my MainActivity.java:
>
> MediaPlayer mediaPlayer = MediaPlayer.create(context, R.raw.mysound);
> mediaPlayer.start();
>
> But Studio doesn't like context for some reason (cannot resolve symbol).  I 
> do have
> import android.media.MediaPlayer;
>
>
>
> On Wednesday, November 30, 2016 at 6:10:31 PM UTC-6, Steve Gabrilowitz
> wrote:
>>
>> I suggest that you do a web search for "android life cycle".  The
>> information you find there will not only answer your question but provide
>> you with some basic knowledge that any android developer must know!
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Android Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to android-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/android-developers.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/android-developers/4ac16e38-ab12-4899-8234-
> c3b2e00c9ee3%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/CABfabRhMdPwSsdyqC1C9Qk0hoEKZxoDtdfTo66xG%2B8bq84u2XA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] newbie needs help - play a sound when app opens

2016-12-01 Thread chicago chuck
Thanks for the reply Steve.

I have the following in my MainActivity.java:

MediaPlayer mediaPlayer = MediaPlayer.create(context, R.raw.mysound);
mediaPlayer.start();

But Studio doesn't like context for some reason (cannot resolve symbol).  I do 
have 
import android.media.MediaPlayer;



On Wednesday, November 30, 2016 at 6:10:31 PM UTC-6, Steve Gabrilowitz 
wrote:
>
> I suggest that you do a web search for "android life cycle".  The 
> information you find there will not only answer your question but provide 
> you with some basic knowledge that any android developer must know!
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/4ac16e38-ab12-4899-8234-c3b2e00c9ee3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] newbie needs help - play a sound when app opens

2016-11-30 Thread Steve Gabrilowitz
I suggest that you do a web search for "android life cycle".  The
information you find there will not only answer your question but provide
you with some basic knowledge that any android developer must know!

On Nov 30, 2016 6:17 PM, "chicago chuck"  wrote:

> Hello,
>
> I'm a newbie with Android Studio.
>
> I've created a very basic app with various TextViews and ImageViews. I
> want to take the next step and have my app play a sound when it opens.
>
> I've googled around and found a lot of info about playing a sound when a
> button is clicked, but I didn't want to start getting into buttons yet. I
> just want it to play my mp3 when it first opens.
>
> I figured out how to create the raw folder and paste my mp3 file into it.
>
> Is there a way to play a sound when my app first opens?
>
> Note that this is my first attempt at doing anything with
> MainActivity.java, so if you have a code example, please let me know where
> it goes.
>
> thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Android Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to android-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/android-developers.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/android-developers/2f6d3649-ca7e-4e0d-8f3f-
> 6c7853b690e6%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/CABfabRhj3%3DY5pS-Vq29wgfWz4AsbXzTCW16p4TZe3OHcDV_0Hw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] newbie needs help - play a sound when app opens

2016-11-30 Thread chicago chuck
Hello,

I'm a newbie with Android Studio.

I've created a very basic app with various TextViews and ImageViews. I want 
to take the next step and have my app play a sound when it opens.

I've googled around and found a lot of info about playing a sound when a 
button is clicked, but I didn't want to start getting into buttons yet. I 
just want it to play my mp3 when it first opens.

I figured out how to create the raw folder and paste my mp3 file into it.

Is there a way to play a sound when my app first opens?

Note that this is my first attempt at doing anything with 
MainActivity.java, so if you have a code example, please let me know where 
it goes.

thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/2f6d3649-ca7e-4e0d-8f3f-6c7853b690e6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.