[android-developers] When switching content views sending over a variable?

2010-09-14 Thread arberb
Im trying to switch content views on my application and I wanna send
over a variable along with it.
So my main class has a button and when you click it, it brings you to
a different content view (I have an intent setup) so yeah in the main
class it has a variable and I wanna bring it to the new content view.
how can I do this?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Copying 1 drawable to SD

2010-09-12 Thread arberb
I wanna copy a drawable to the sd card.
Lets say I have picture
1.jpg
in my drawable folder and I want the app to copy it to the sd card
when a certain button is pressed how can I do this>?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Saving drawables to sd card?

2010-09-12 Thread arberb
My application has alot of pictures in it and I was wondering if its
possible if one of my users click a button to send that picture to the
sd card? If this is possible please let me know

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Audio in the RAW Folder is not able to play....

2010-04-28 Thread arberb
At the moment im working on an application which uses audio files and
the issue is when ever my audio file gets called it gives me this
error:

20:51:12.061916 ERROR   AndroidRuntime  Uncaught handler:
thread main
exiting due to uncaught exception
20:51:12.092916 ERROR   AndroidRuntime
java.lang.RuntimeException:
Unable to start activity ComponentInfo{org.me.zx/
org.me.zx.MainActivity}: android.content.res.Resources
$NotFoundException: File res/raw/a.ogg from drawable resource ID
#0x7f04
20:51:12.092916 ERROR   AndroidRuntime  at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2268)
20:51:12.092916 ERROR   AndroidRuntime  at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2284)
20:51:12.092916 ERROR   AndroidRuntime  at
android.app.ActivityThread.access$1800(ActivityThread.java:112)
20:51:12.092916 ERROR   AndroidRuntime  at
android.app.ActivityThread
$H.handleMessage(ActivityThread.java:1692)
20:51:12.092916 ERROR   AndroidRuntime  at
android.os.Handler.dispatchMessage(Handler.java:99)
20:51:12.092916 ERROR   AndroidRuntime  at
android.os.Looper.loop(Looper.java:123)
20:51:12.092916 ERROR   AndroidRuntime  at
android.app.ActivityThread.main(ActivityThread.java:3948)
20:51:12.092916 ERROR   AndroidRuntime  at
java.lang.reflect.Method.invokeNative(Native Method)
20:51:12.092916 ERROR   AndroidRuntime  at
java.lang.reflect.Method.invoke(Method.java:521)
20:51:12.092916 ERROR   AndroidRuntime  at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:782)
20:51:12.092916 ERROR   AndroidRuntime  at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
20:51:12.092916 ERROR   AndroidRuntime  at
dalvik.system.NativeStart.main(Native Method)
20:51:12.092916 ERROR   AndroidRuntime  Caused by:
android.content.res.Resources$NotFoundException: File res/raw/a.ogg
from drawable resource ID #0x7f04
20:51:12.092916 ERROR   AndroidRuntime  at
android.content.res.Resources.openRawResourceFd(Resources.java:814)
20:51:12.092916 ERROR   AndroidRuntime  at
android.media.SoundPool.load(SoundPool.java:172)
20:51:12.092916 ERROR   AndroidRuntime  at
org.me.zx.SoundManager.addSound(SoundManager.java:27)
20:51:12.092916 ERROR   AndroidRuntime  at
org.me.zx.MainActivity.onCreate(MainActivity.java:22)
20:51:12.092916 ERROR   AndroidRuntime  at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1123)
20:51:12.092916 ERROR   AndroidRuntime  at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2231)
20:51:12.092916 ERROR   AndroidRuntime  ... 11 more
20:51:12.092916 ERROR   AndroidRuntime  Caused by:
java.io.FileNotFoundException: This file can not be opened as a file
descriptor; it is probably compressed
20:51:12.092916 ERROR   AndroidRuntime  at
android.content.res.AssetManager.openNonAssetFdNative(Native Method)
20:51:12.092916 ERROR   AndroidRuntime  at
android.content.res.AssetManager.openNonAssetFd(AssetManager.java:412)
20:51:12.092916 ERROR   AndroidRuntime  at
android.content.res.Resources.openRawResourceFd(Resources.java:811)
20:51:12.092916 ERROR   AndroidRuntime  ... 16 more

This is what I have tried:
-Using MediaPlayer
-Using Audio Player
-Trying MP3 files, OGG, WAV Files
-Using eclispe to compile instead of netbeans
-Deleting my raw folder and adding the files again
-Deleting my R.java file

The file is only 2kb mp3 and 30kb .ogg and 130kb wav

HERES A SCREENSHOT OF MY CODE + PROOF THERES AN a.ogg file:
http://i43.tinypic.com/jpexdz.png

Does anyone have any suggestions on how do I fix this?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Cannot Play Audio Files In The RAW Folder

2010-04-28 Thread arberb
There a.ogg file is there inside the raw folder. I dont know whats
wrong with it. I have checked several times.

On Apr 28, 7:44 am, Nithin  wrote:
> The error is,
>
> Resources
> $NotFoundException: File res/raw/a.ogg from drawable resource ID
> #0x7f04
>
> check whether you properly place your a.ogg file in raw folder
>
> Nithin
>
> On Apr 28, 4:22 pm, AJ  wrote:
>
>
>
>
>
> > Paste some sample code so the people can actually see what is missing
> > from your code.
>
> > Thanks,
> > AJ
>
> > On Apr 28, 2:16 pm,arberb wrote:
>
> > > At the moment im working on an application which uses audio files and
> > > the issue is when ever my audio file gets called it gives me this
> > > error:
>
> > > 20:51:12.061    916     ERROR   AndroidRuntime  Uncaught handler: thread 
> > > main
> > > exiting due to uncaught exception
> > > 20:51:12.092    916     ERROR   AndroidRuntime  
> > > java.lang.RuntimeException:
> > > Unable to start activity ComponentInfo{org.me.zx/
> > > org.me.zx.MainActivity}: android.content.res.Resources
> > > $NotFoundException: File res/raw/a.ogg from drawable resource ID
> > > #0x7f04
> > > 20:51:12.092    916     ERROR   AndroidRuntime      at
> > > android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
> > > 2268)
> > > 20:51:12.092    916     ERROR   AndroidRuntime      at
> > > android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
> > > 2284)
> > > 20:51:12.092    916     ERROR   AndroidRuntime      at
> > > android.app.ActivityThread.access$1800(ActivityThread.java:112)
> > > 20:51:12.092    916     ERROR   AndroidRuntime      at 
> > > android.app.ActivityThread
> > > $H.handleMessage(ActivityThread.java:1692)
> > > 20:51:12.092    916     ERROR   AndroidRuntime      at
> > > android.os.Handler.dispatchMessage(Handler.java:99)
> > > 20:51:12.092    916     ERROR   AndroidRuntime      at
> > > android.os.Looper.loop(Looper.java:123)
> > > 20:51:12.092    916     ERROR   AndroidRuntime      at
> > > android.app.ActivityThread.main(ActivityThread.java:3948)
> > > 20:51:12.092    916     ERROR   AndroidRuntime      at
> > > java.lang.reflect.Method.invokeNative(Native Method)
> > > 20:51:12.092    916     ERROR   AndroidRuntime      at
> > > java.lang.reflect.Method.invoke(Method.java:521)
> > > 20:51:12.092    916     ERROR   AndroidRuntime      at
> > > com.android.internal.os.ZygoteInit
> > > $MethodAndArgsCaller.run(ZygoteInit.java:782)
> > > 20:51:12.092    916     ERROR   AndroidRuntime      at
> > > com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
> > > 20:51:12.092    916     ERROR   AndroidRuntime      at
> > > dalvik.system.NativeStart.main(Native Method)
> > > 20:51:12.092    916     ERROR   AndroidRuntime  Caused by:
> > > android.content.res.Resources$NotFoundException: File res/raw/a.ogg
> > > from drawable resource ID #0x7f04
> > > 20:51:12.092    916     ERROR   AndroidRuntime      at
> > > android.content.res.Resources.openRawResourceFd(Resources.java:814)
> > > 20:51:12.092    916     ERROR   AndroidRuntime      at
> > > android.media.SoundPool.load(SoundPool.java:172)
> > > 20:51:12.092    916     ERROR   AndroidRuntime      at
> > > org.me.zx.SoundManager.addSound(SoundManager.java:27)
> > > 20:51:12.092    916     ERROR   AndroidRuntime      at
> > > org.me.zx.MainActivity.onCreate(MainActivity.java:22)
> > > 20:51:12.092    916     ERROR   AndroidRuntime      at
> > > android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
> > > 1123)
> > > 20:51:12.092    916     ERROR   AndroidRuntime      at
> > > android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
> > > 2231)
> > > 20:51:12.092    916     ERROR   AndroidRuntime      ... 11 more
> > > 20:51:12.092    916     ERROR   AndroidRuntime  Caused by:
> > > java.io.FileNotFoundException: This file can not be opened as a file
> > > descriptor; it is probably compressed
> > > 20:51:12.092    916     ERROR   AndroidRuntime      at
> > > android.content.res.AssetManager.openNonAssetFdNative(Native Method)
> > > 20:51:12.092    916     ERROR   AndroidRuntime      at
> > > android.content.res.AssetManager.openNonAssetFd(AssetManager.java:412)
> > > 20:51:12.092    916     ERROR   AndroidRuntime      at
> > > android.content.res.Resources.openRawResourceFd

[android-developers] Cannot Play Audio Files In The RAW Folder

2010-04-28 Thread arberb
At the moment im working on an application which uses audio files and
the issue is when ever my audio file gets called it gives me this
error:

20:51:12.061916 ERROR   AndroidRuntime  Uncaught handler: thread main
exiting due to uncaught exception
20:51:12.092916 ERROR   AndroidRuntime  java.lang.RuntimeException:
Unable to start activity ComponentInfo{org.me.zx/
org.me.zx.MainActivity}: android.content.res.Resources
$NotFoundException: File res/raw/a.ogg from drawable resource ID
#0x7f04
20:51:12.092916 ERROR   AndroidRuntime  at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2268)
20:51:12.092916 ERROR   AndroidRuntime  at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2284)
20:51:12.092916 ERROR   AndroidRuntime  at
android.app.ActivityThread.access$1800(ActivityThread.java:112)
20:51:12.092916 ERROR   AndroidRuntime  at 
android.app.ActivityThread
$H.handleMessage(ActivityThread.java:1692)
20:51:12.092916 ERROR   AndroidRuntime  at
android.os.Handler.dispatchMessage(Handler.java:99)
20:51:12.092916 ERROR   AndroidRuntime  at
android.os.Looper.loop(Looper.java:123)
20:51:12.092916 ERROR   AndroidRuntime  at
android.app.ActivityThread.main(ActivityThread.java:3948)
20:51:12.092916 ERROR   AndroidRuntime  at
java.lang.reflect.Method.invokeNative(Native Method)
20:51:12.092916 ERROR   AndroidRuntime  at
java.lang.reflect.Method.invoke(Method.java:521)
20:51:12.092916 ERROR   AndroidRuntime  at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:782)
20:51:12.092916 ERROR   AndroidRuntime  at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
20:51:12.092916 ERROR   AndroidRuntime  at
dalvik.system.NativeStart.main(Native Method)
20:51:12.092916 ERROR   AndroidRuntime  Caused by:
android.content.res.Resources$NotFoundException: File res/raw/a.ogg
from drawable resource ID #0x7f04
20:51:12.092916 ERROR   AndroidRuntime  at
android.content.res.Resources.openRawResourceFd(Resources.java:814)
20:51:12.092916 ERROR   AndroidRuntime  at
android.media.SoundPool.load(SoundPool.java:172)
20:51:12.092916 ERROR   AndroidRuntime  at
org.me.zx.SoundManager.addSound(SoundManager.java:27)
20:51:12.092916 ERROR   AndroidRuntime  at
org.me.zx.MainActivity.onCreate(MainActivity.java:22)
20:51:12.092916 ERROR   AndroidRuntime  at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1123)
20:51:12.092916 ERROR   AndroidRuntime  at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2231)
20:51:12.092916 ERROR   AndroidRuntime  ... 11 more
20:51:12.092916 ERROR   AndroidRuntime  Caused by:
java.io.FileNotFoundException: This file can not be opened as a file
descriptor; it is probably compressed
20:51:12.092916 ERROR   AndroidRuntime  at
android.content.res.AssetManager.openNonAssetFdNative(Native Method)
20:51:12.092916 ERROR   AndroidRuntime  at
android.content.res.AssetManager.openNonAssetFd(AssetManager.java:412)
20:51:12.092916 ERROR   AndroidRuntime  at
android.content.res.Resources.openRawResourceFd(Resources.java:811)
20:51:12.092916 ERROR   AndroidRuntime  ... 16 more


This is what I have tried:
-Using MediaPlayer
-Using Audio Player
-Trying MP3 files, OGG, WAV Files
-Using eclispe to compile instead of netbeans
-Deleting my raw folder and adding the files again
-Deleting my R.java file

The file is only 2kb mp3 and 30kb .ogg and 130kb wav

Does anyone have any suggestions on how do I fix this?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Issue with MediaPLayer

2010-04-27 Thread arberb
This is my script:
public class MainActivity extends Activity {

@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
this.setContentView(R.layout.main);

Button myButton = (Button)this.findViewById(R.id.my_button);
myButton.setOnClickListener(new OnClickListener(){
   @Override
   public void onClick(View arg0) {
MediaPlayer mp =
MediaPlayer.create(MainActivity.this,
  R.raw.xd);
mp.start();
// i.e. react on the end of the music-file:
mp.setOnCompletionListener(new
OnCompletionListener(){

 // @Override
 public void onCompletion(MediaPlayer arg0) {
  // File has ended !!! Wink
 }
});
   }
});
}
}


but when I click the button in my app the application crashes. Why
does this happen?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Quick & Easy Question

2010-04-19 Thread arberb
Is it possible to open up a music player when someone clicks a certain
link? Like a music player popup or something in my application?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en