[android-developers] How to auto-update next version of App on all previous installations?

2015-07-01 Thread NewToAndroid
Hi All,

I have an App published on play store. Recently, I have put the next 
version of the App.
But, the next version is not installed (i.e. upgraded) on previous 
installations automatically.
How can I make the App auto update?
Also, is it a valid expectation that the App should auto-update itself, 
when next version is available ?
Please help.

Thanks in advance

-- 
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
--- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] Problem when publishing next version of my App

2015-06-25 Thread NewToAndroid
Thanks Guys. Changing gradle build file worked

On Saturday, June 20, 2015 at 4:16:14 PM UTC+1, richarth wrote:

 Are you using Gradle for your build?  If you are using Gradle for your 
 build then the version settings in your Gradle file will take precedence 
 over the value in your manifest file.

 If you open up the build.gradle file for your module in the defaultConfig 
 block there will be two lines:

 versionCode 1
 versionName 1.0

 Change these to:

 versionCode 2
 versionName 2.0

 and that should do the trick.

 On 20 June 2015 at 13:00, NewToAndroid rahul...@gmail.com javascript: 
 wrote:

 Hi All,

 I have a small app already live on Play Store. As I was new to Android, I 
 totally forgot to mention any version on the manifest file. There was no 
 versionCode or versionName in the first version of apk, which is live now.
 However, it is shown as version 1 in the developer console.

 Now I want to submit the upgrade i.e. next version.

 I have added following lines to the manifest file

 manifest xmlns:android=http://schemas.android.com/apk/res/android;
 package=com.mobile.mypackagename
 android:versionCode=2
 android:versionName=2.0
 

 Generated the release apk. Then I tried to upload the new apk file by 
 clicking on Upload new apk to Production.
 But, I am getting error,* Upload failed. You need to use a different 
 version code for your APK because you already have one with version code 
 1.*

 What is the problem here ?

 Thanks in advance

 -- 
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-d...@googlegroups.com 
 javascript:
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com javascript:
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en
 --- 
 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 javascript:.
 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 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
--- 
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.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Problem when publishing next version of my App

2015-06-20 Thread NewToAndroid
Hi All,

I have a small app already live on Play Store. As I was new to Android, I 
totally forgot to mention any version on the manifest file. There was no 
versionCode or versionName in the first version of apk, which is live now.
However, it is shown as version 1 in the developer console.

Now I want to submit the upgrade i.e. next version.

I have added following lines to the manifest file

manifest xmlns:android=http://schemas.android.com/apk/res/android;
package=com.mobile.mypackagename
android:versionCode=2
android:versionName=2.0


Generated the release apk. Then I tried to upload the new apk file by 
clicking on Upload new apk to Production.
But, I am getting error,* Upload failed. You need to use a different 
version code for your APK because you already have one with version code 
1.*

What is the problem here ?

Thanks in advance

-- 
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
--- 
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.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Notification not working in Android 5.1

2015-06-01 Thread NewToAndroid
Hi All,

I have an app which displays a notification from a service (and the service 
shows notification icon etc etc).
The notification works fine till Android 4.3, I think it also works on 4.4 
(not 100% sure). But it definitely does not work with 5.1.

This is the code I have at the moment (which is not working on Lolipop).

private void displayNotification(){

String ns = Context.NOTIFICATION_SERVICE ;
NotificationManager mNotificationManager = (NotificationManager) 
getSystemService(ns);
int icon = R.drawable.ns_small ;
CharSequence ticketText = Some Text;
long when = System.currentTimeMillis();
Notification notification = new Notification  ( icon, ticketText, 
when );
notification.flags = Notification.FLAG_ONGOING_EVENT ;
Context context = getApplicationContext() ;
CharSequence  contentTitle = Some more text;
CharSequence contentText = Again some more text;
Intent notificationIntent = new Intent (this, MainActivity.class);
PendingIntent contentIntent = PendingIntent.getActivity (context, 
0, notificationIntent, 0 );
notification.setLatestEventInfo(context, contentTitle, contentText, 
contentIntent );
mNotificationManager.notify( NOTIFICATION_ID, notification );

}

I tried to find out from documentation. I can see that notification API is 
changed in 5.0. Main question is, if I use the new API, will it work on 
earlier versions of Android ??
At this point in time, there are more Android 3.X and 4.X based devices 
than 5.X. So, I want to application to run across all these versions.
How can I do that ?

Thanks in advance.

-- 
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
--- 
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.
For more options, visit https://groups.google.com/d/optout.


[android-developers] apk name for Google play

2015-05-01 Thread NewToAndroid
Hi all,

I want to publish my app on Google play. When I create the signed apk (with 
Android Studio), it creates the file with name apk-release.apk.
It does not look appropriate to me to upload apk file with that name on Google 
play. Is it ok if I just rename the apk file before upload ?
Does it matter to have a proper name for the apk file ?

Can you guys share your experiences regarding the name of the apk file ?
what if I add the version number in the apk file name ? e.g. MyApp_1.0.apk

Thanks in advance

-- 
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
--- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] Which activity method is good for a continuous loop?

2015-04-21 Thread NewToAndroid
Thanks for the guidance.
I will go for the broadcast-receiver mechanism, that is technically better. 
I will stop the service when we loose internet connection and start it when 
internet is back on

-- 
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
--- 
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.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Which activity method is good for a continuous loop?

2015-04-17 Thread NewToAndroid
Hi all,

I have a very simple app, which has 1 screen with few buttons. It will start a 
service which will pay music using mediaplayer.
Now, sometimes if I go in no internet coverage area or move between 3g and 
wifi, the player stops and service completes (does its onDestroy).

I am thinking of writting a simple loop, which will check if the service is 
running after every 10 secnds (or something like that) and if the service is 
down, it will start it.
Question is, where should I write this loop in the activity code ? which method 
is better suited to have this loop which is continuously running ? onStart? 
Any other better ideas ? (I am sure there will be)

Thanks in advance

-- 
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
--- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] Which activity method is good for a continuous loop?

2015-04-17 Thread NewToAndroid
Yes. It might be the case that I am not going to the root cause.

I have a main activity, which starts a service. The service creates a 
MediaPlayer object and plays a MP3. This MP3 is not a mp3 file, but it is 
the live stream which is played over internet. 
When there is no internet connectivity, the mediaplayer assumes, the mp3 it 
was playing is finished and performs onComplete method. I had put stopself 
in onCompletion, so the service is stopping.

Now, somewhere I would like to have this code that, if the mediaplayer has 
completed itself (without the user stopping it), I want to re-try to create 
the mediaplayer again and run it. I am not sure, where should this code 
sit? where means, which callback of the service or the mediaplayer can have 
this check and re-start logic.


On Friday, April 17, 2015 at 3:07:43 PM UTC+1, MagouyaWare wrote:

 It sounds like you are trying to fix the symptom of a problem rather than 
 address the actual issue.  The real question should be Why does my 
 service get destroyed?

 Have you looked into why your service gets destroyed? What kind of service 
 are you using (hopefully not IntentService)?

 On Fri, Apr 17, 2015 at 8:52 AM NewToAndroid rahul...@gmail.com 
 javascript: wrote:

 Hi all,

 I have a very simple app, which has 1 screen with few buttons. It will 
 start a service which will pay music using mediaplayer.
 Now, sometimes if I go in no internet coverage area or move between 3g 
 and wifi, the player stops and service completes (does its onDestroy).

 I am thinking of writting a simple loop, which will check if the service 
 is running after every 10 secnds (or something like that) and if the 
 service is down, it will start it.
 Question is, where should I write this loop in the activity code ? which 
 method is better suited to have this loop which is continuously running ? 
 onStart?
 Any other better ideas ? (I am sure there will be)

 Thanks in advance

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-d...@googlegroups.com 
 javascript:
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com javascript:
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en
 ---
 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 javascript:.
 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 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
--- 
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.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Service dies when no internet connectivity

2015-04-13 Thread NewToAndroid
Hi all,

I have developed an app which steams music live in a service. The service is 
started with an intent from the activity. It works fine. Basically, I am using 
media player object, which plays music in the service (which I started with 
intent).
But when I was driving thru some remote hilly area, where there is no internet 
connectivity, the service stopped playing music. When I checked later, the 
service has stopped. What is the concept behind this ?

What can be the best/established way of handling this situation ?

Thanks in advance

-- 
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
--- 
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.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Which layout(s) can help me ?

2015-04-05 Thread NewToAndroid
HI All,

I am developing a most simple looking app. But being new to Android 
struggling with a (probably) minor issue.

On my front screen there is an image (kind of logo) at the top and centre, 
which is a typical rectangular image. This might take top 25% or 30% of the 
screen of a typical phone. Whatever space is left after this image, in the 
remaining space, I want to place a button at the centre.

So basically, divide the screen in 2 parts, top 25 or 30% will have a fix 
image. Remaining part need to have a button at its centre. This should hold 
the same alignment when phone a tilted by 90 degrees and back to normal.
Relative layout does not allow me to place something at the centre of 
remaining screen (or have I hot it totally wrong).

How / which layout or layouts should I use here ??
Please guide.

Thanks in advance

-- 
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
--- 
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.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Is it internet connection issue ?

2015-03-25 Thread NewToAndroid
Its me again. 
It was my own silly mistake that was causing me grief which I put in the post 
here.
I had the permissions mentioed inside the application tag, it should be 
outside that tag.

-- 
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
--- 
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.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Is it internet connection issue ?

2015-03-23 Thread NewToAndroid

Hi all,

I am developing a live audio streaming app on Android Studio 1.0.1 and testing 
it on Samsung Galaxy s3 phone (not on emulator).

First I was getting IOException when i was doing setDataSource on media player 
object when using http:// url. I have set the INTERNET permission in manifest, 
still the issue was there (with different implementations of setDataSource).

Then I found out that, I need to have Access_network_state set in manifest. The 
moment I set that in manifest, I started getting error neither the user nor 
current process has access network state  permission.
I have tried writting  access_network_state twice in the manifest (as suggested 
by few google search) and also, I have tried doing clean and build of the 
project.
Still getting the error neither user nor process has access_network_state  
error.

Is this a permission setup issue ?? 
when I am deploying the app from my laptop to the phone over a usb cable, is it 
not setting up the network access permissions ?
After an app is installed on my phone, how can I check, what permissions does 
the app have ??

I am thinking that, either on android studio or in my phone, I might have to do 
some settings so that, the permissions are actually given to the app 
while/after deployment.

Please help. I am on the verge of giving up 

Thanks in advance.

-- 
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
--- 
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.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Is it internet connection issue ?

2015-03-23 Thread NewToAndroid
Hi All,

Its me again. I am adding to my original post here.
Looks like it is permissioning problem.

I have added following lines in the manifest file,

uses-permission android:name=android.permission.INTERNET /
uses-permission 
android:name=android.permission.ACCESS_NETWORK_STATE /

Till now, I let Android development studio install the app directly on to 
the phone, connected by USB cable. This time I copied the apk file from my 
laptop(manually)  to one folder on my phone (Galaxy S3). Then, I clicked on 
the apk file ad installed it.
Before installing, the app installer asked this app does not require any 
special permissions, do you want to install ?. Why is this ??
As I have added the entries in the manifest file, I was expecting that, 
before installing, Android will ask me about these 2 permissions.

Is there any problem with the build ? Do I need to change any setting in 
studio so that, the apk file will pick up the permission information ??

Please help.

On Monday, March 23, 2015 at 4:03:38 PM UTC, NewToAndroid wrote:


 Hi all, 

 I am developing a live audio streaming app on Android Studio 1.0.1 and 
 testing it on Samsung Galaxy s3 phone (not on emulator). 

 First I was getting IOException when i was doing setDataSource on media 
 player object when using http:// url. I have set the INTERNET permission in 
 manifest, still the issue was there (with different implementations of 
 setDataSource). 

 Then I found out that, I need to have Access_network_state set in 
 manifest. The moment I set that in manifest, I started getting error 
 neither the user nor current process has access network state 
  permission. 
 I have tried writting  access_network_state twice in the manifest (as 
 suggested by few google search) and also, I have tried doing clean and 
 build of the project. 
 Still getting the error neither user nor process has access_network_state 
  error. 

 Is this a permission setup issue ?? 
 when I am deploying the app from my laptop to the phone over a usb cable, 
 is it not setting up the network access permissions ? 
 After an app is installed on my phone, how can I check, what permissions 
 does the app have ?? 

 I am thinking that, either on android studio or in my phone, I might have 
 to do some settings so that, the permissions are actually given to the app 
 while/after deployment. 

 Please help. I am on the verge of giving up  

 Thanks in advance. 


-- 
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
--- 
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.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Getting FileNotFound exception when URL is valid

2015-03-17 Thread NewToAndroid
Yes. I have internet permission set in manifest.

I tried setDataSource.

 mediaPlayer.setDataSource( this, Uri.parse( myURL ));

I don't know what has gone wrong here. When I am calling set data source, 
it's throwing error. In logcat, I can see messages like,

I/MediaPlayer﹕ path is null

D/MediaPlayer﹕ setDataSource IOException happend

D/MediaPlayer﹕ Couldn't open file on client side, trying server side

Probably, it is looking for the file locally. How can I make the api look 
for my file on internet, at the given URL ???


On Monday, March 16, 2015 at 9:32:42 AM UTC, Oleksii Bieliaiev wrote:

 Hi.

 Did you set android.permission.INTERNET permission?

 Regards,
 Alex


 On Monday, March 16, 2015 at 1:53:13 AM UTC+1, NewToAndroid wrote:

 I tried that and now it is giving different error

 03-16 00:25:53.020  29074-29074/com.example.android.playlivesound E/﹕ 
 mali: REVISION=Linux-r3p2-01rel3 BUILD_DATE=Wed Oct  9 21:05:57 KST 2013
 03-16 00:25:53.105  29074-29074/com.example.android.playlivesound 
 D/OpenGLRenderer﹕ Enabling debug mode 0
 03-16 00:25:53.870  29074-29074/com.example.android.playlivesound 
 I/Choreographer﹕ Skipped 44 frames!  The application may be doing too much 
 work on its main thread.
 03-16 00:26:08.910  29074-29074/com.example.android.playlivesound 
 E/MediaPlayer﹕ Unable to to create media player
 03-16 00:26:08.915  29074-29074/com.example.android.playlivesound 
 W/System.err﹕ java.io.IOException: setDataSource failed.: status=0x8000
 03-16 00:26:08.940  29074-29074/com.example.android.playlivesound 
 W/System.err﹕ at android.media.MediaPlayer._setDataSource(Native Method)
 03-16 00:26:08.940  29074-29074/com.example.android.playlivesound 
 W/System.err﹕ at 
 android.media.MediaPlayer.setDataSource(MediaPlayer.java:1185)
 03-16 00:26:08.940  29074-29074/com.example.android.playlivesound 
 W/System.err﹕ at 
 android.media.MediaPlayer.setDataSource(MediaPlayer.java:1102)
 03-16 00:26:08.940  29074-29074/com.example.android.playlivesound 
 W/System.err﹕ at 
 com.example.android.playlivesound.MainActivity$1.onClick(MainActivity.java:46)
 03-16 00:26:08.940  29074-29074/com.example.android.playlivesound 
 W/System.err﹕ at android.view.View.performClick(View.java:4475)
 03-16 00:26:08.940  29074-29074/com.example.android.playlivesound 
 W/System.err﹕ at android.view.View$PerformClick.run(View.java:18786)
 03-16 00:26:08.940  29074-29074/com.example.android.playlivesound 
 W/System.err﹕ at android.os.Handler.handleCallback(Handler.java:730)
 03-16 00:26:08.940  29074-29074/com.example.android.playlivesound 
 W/System.err﹕ at android.os.Handler.dispatchMessage(Handler.java:92)
 03-16 00:26:08.945  29074-29074/com.example.android.playlivesound 
 W/System.err﹕ at android.os.Looper.loop(Looper.java:176)
 03-16 00:26:08.945  29074-29074/com.example.android.playlivesound 
 W/System.err﹕ at android.app.ActivityThread.main(ActivityThread.java:5419)
 03-16 00:26:08.945  29074-29074/com.example.android.playlivesound 
 W/System.err﹕ at java.lang.reflect.Method.invokeNative(Native Method)
 03-16 00:26:08.945  29074-29074/com.example.android.playlivesound 
 W/System.err﹕ at java.lang.reflect.Method.invoke(Method.java:525)
 03-16 00:26:08.945  29074-29074/com.example.android.playlivesound 
 W/System.err﹕ at 
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)
 03-16 00:26:08.945  29074-29074/com.example.android.playlivesound 
 W/System.err﹕ at 
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)
 03-16 00:26:08.945  29074-29074/com.example.android.playlivesound 
 W/System.err﹕ at dalvik.system.NativeStart.main(Native Method)
 03-16 00:27:23.000  29074-29074/com.example.android.playlivesound 
 D/dalvikvm﹕ GC_EXPLICIT freed 275K, 13% free 10262K/11728K, paused 4ms+3ms, 
 total 48ms
 03-16 00:28:33.670  29074-29074/com.example.android.playlivesound 
 E/MediaPlayer﹕ Unable to to create media player

 What can be the reason? Is it only because I have not put the prepare 
 method in a service ? and have included it in main thread?



 On Sunday, March 15, 2015 at 8:57:22 PM UTC, Jonathan S wrote:

 it is looking for files in the assets directory over 
 ContentResolver.openAssetFileDescriptor.

 You should have to use 
 http://developer.android.com/reference/android/media/MediaPlayer.html#setDataSource%28java.lang.String%29

 you would need prepareAsync too

 On Sunday, March 15, 2015 at 8:35:57 AM UTC-4, NewToAndroid wrote:

 Hi,

 Few other developers have asked this question before, I checked those 
 posts. But looks like I have a different issue here.
 I am using Android Developer Studio 1.0.1 sitting on JRE 1,7 (on a 
 windows laptop).

 I am developing an App around a live streaming audio, using MediaPlayer 
 class.
 If I place the URL in browser, which looks like, 
 http://something.org.uk:8000/blah.mp3, the URL woks/plays perfectly 
 fine from the browser.

 But my code
 mediaPlayer = MediaPlayer.create(MainActivity.this, Uri.parse(
 http

[android-developers] Getting FileNotFound exception when URL is valid

2015-03-15 Thread NewToAndroid
Hi,

Few other developers have asked this question before, I checked those 
posts. But looks like I have a different issue here.
I am using Android Developer Studio 1.0.1 sitting on JRE 1,7 (on a windows 
laptop).

I am developing an App around a live streaming audio, using MediaPlayer 
class.
If I place the URL in browser, which looks 
like, http://something.org.uk:8000/blah.mp3, the URL woks/plays perfectly 
fine from the browser.

But my code
mediaPlayer = MediaPlayer.create(MainActivity.this, 
Uri.parse(http://something.org.uk:8000/blah.mp3;));
mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
mediaPlayer.start();

gives exception

java.io.FileNotFoundException: No content provider: 
http://something.org.uk:8000/blah.mp3
at 
android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:761)
at 
android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:665)
at android.media.MediaPlayer.setDataSource(MediaPlayer.java:960)
at android.media.MediaPlayer.setDataSource(MediaPlayer.java:914)
at android.media.MediaPlayer.create(MediaPlayer.java:837)
at android.media.MediaPlayer.create(MediaPlayer.java:818)
at 
com.example.android.playlivenusound.MainActivity$1.onClick(MainActivity.java:52)
at android.view.View.performClick(View.java:4475)
at android.view.View$PerformClick.run(View.java:18786)
at android.os.Handler.handleCallback(Handler.java:730)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:5419)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)
at dalvik.system.NativeStart.main(Native Method)

If I use a local MP3 file (added to the raw folder), it works fine.
What am I missing here ??

Please help.

Thanks in advance.

-- 
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
--- 
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.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Getting FileNotFound exception when URL is valid

2015-03-15 Thread NewToAndroid
I tried that and now it is giving different error

03-16 00:25:53.020  29074-29074/com.example.android.playlivesound E/﹕ mali: 
REVISION=Linux-r3p2-01rel3 BUILD_DATE=Wed Oct  9 21:05:57 KST 2013
03-16 00:25:53.105  29074-29074/com.example.android.playlivesound 
D/OpenGLRenderer﹕ Enabling debug mode 0
03-16 00:25:53.870  29074-29074/com.example.android.playlivesound 
I/Choreographer﹕ Skipped 44 frames!  The application may be doing too much 
work on its main thread.
03-16 00:26:08.910  29074-29074/com.example.android.playlivesound 
E/MediaPlayer﹕ Unable to to create media player
03-16 00:26:08.915  29074-29074/com.example.android.playlivesound 
W/System.err﹕ java.io.IOException: setDataSource failed.: status=0x8000
03-16 00:26:08.940  29074-29074/com.example.android.playlivesound 
W/System.err﹕ at android.media.MediaPlayer._setDataSource(Native Method)
03-16 00:26:08.940  29074-29074/com.example.android.playlivesound 
W/System.err﹕ at 
android.media.MediaPlayer.setDataSource(MediaPlayer.java:1185)
03-16 00:26:08.940  29074-29074/com.example.android.playlivesound 
W/System.err﹕ at 
android.media.MediaPlayer.setDataSource(MediaPlayer.java:1102)
03-16 00:26:08.940  29074-29074/com.example.android.playlivesound 
W/System.err﹕ at 
com.example.android.playlivesound.MainActivity$1.onClick(MainActivity.java:46)
03-16 00:26:08.940  29074-29074/com.example.android.playlivesound 
W/System.err﹕ at android.view.View.performClick(View.java:4475)
03-16 00:26:08.940  29074-29074/com.example.android.playlivesound 
W/System.err﹕ at android.view.View$PerformClick.run(View.java:18786)
03-16 00:26:08.940  29074-29074/com.example.android.playlivesound 
W/System.err﹕ at android.os.Handler.handleCallback(Handler.java:730)
03-16 00:26:08.940  29074-29074/com.example.android.playlivesound 
W/System.err﹕ at android.os.Handler.dispatchMessage(Handler.java:92)
03-16 00:26:08.945  29074-29074/com.example.android.playlivesound 
W/System.err﹕ at android.os.Looper.loop(Looper.java:176)
03-16 00:26:08.945  29074-29074/com.example.android.playlivesound 
W/System.err﹕ at android.app.ActivityThread.main(ActivityThread.java:5419)
03-16 00:26:08.945  29074-29074/com.example.android.playlivesound 
W/System.err﹕ at java.lang.reflect.Method.invokeNative(Native Method)
03-16 00:26:08.945  29074-29074/com.example.android.playlivesound 
W/System.err﹕ at java.lang.reflect.Method.invoke(Method.java:525)
03-16 00:26:08.945  29074-29074/com.example.android.playlivesound 
W/System.err﹕ at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)
03-16 00:26:08.945  29074-29074/com.example.android.playlivesound 
W/System.err﹕ at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)
03-16 00:26:08.945  29074-29074/com.example.android.playlivesound 
W/System.err﹕ at dalvik.system.NativeStart.main(Native Method)
03-16 00:27:23.000  29074-29074/com.example.android.playlivesound 
D/dalvikvm﹕ GC_EXPLICIT freed 275K, 13% free 10262K/11728K, paused 4ms+3ms, 
total 48ms
03-16 00:28:33.670  29074-29074/com.example.android.playlivesound 
E/MediaPlayer﹕ Unable to to create media player

What can be the reason? Is it only because I have not put the prepare 
method in a service ? and have included it in main thread?



On Sunday, March 15, 2015 at 8:57:22 PM UTC, Jonathan S wrote:

 it is looking for files in the assets directory over 
 ContentResolver.openAssetFileDescriptor.

 You should have to use 
 http://developer.android.com/reference/android/media/MediaPlayer.html#setDataSource%28java.lang.String%29

 you would need prepareAsync too

 On Sunday, March 15, 2015 at 8:35:57 AM UTC-4, NewToAndroid wrote:

 Hi,

 Few other developers have asked this question before, I checked those 
 posts. But looks like I have a different issue here.
 I am using Android Developer Studio 1.0.1 sitting on JRE 1,7 (on a 
 windows laptop).

 I am developing an App around a live streaming audio, using MediaPlayer 
 class.
 If I place the URL in browser, which looks like, 
 http://something.org.uk:8000/blah.mp3, the URL woks/plays perfectly fine 
 from the browser.

 But my code
 mediaPlayer = MediaPlayer.create(MainActivity.this, Uri.parse(
 http://something.org.uk:8000/blah.mp3;));
 mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
 mediaPlayer.start();

 gives exception

 java.io.FileNotFoundException: No content provider: 
 http://something.org.uk:8000/blah.mp3
 at 
 android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:761)
 at 
 android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:665)
 at 
 android.media.MediaPlayer.setDataSource(MediaPlayer.java:960)
 at 
 android.media.MediaPlayer.setDataSource(MediaPlayer.java:914)
 at android.media.MediaPlayer.create(MediaPlayer.java:837)
 at android.media.MediaPlayer.create(MediaPlayer.java:818

[android-developers] Why apps not developed in C ?

2014-03-31 Thread NewToAndroid
Hi all,

I have this question out of curiocity.
Android is based on Linux, which is basically written in C. Why Android apps 
are not written in C ? Why Java?

I accept that , I might have big gaps in my understanding of Android, which is 
what I want to clear.

Thanks in advance

-- 
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
--- 
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.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Why apps not developed in C ?

2014-03-31 Thread NewToAndroid
Thats good to know. My intension behind asking this question was, will the apps 
be faster if written in C/C++ ?
But looking at the intro of NDK, they say it won't give significant performance 
improvement if apps developed in c/c++. 
Is it because of the layers of basic Android architechture? Or what?
Any ideas please.

-- 
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
--- 
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.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Cannot run the project in Emulator

2014-03-22 Thread NewToAndroid
Hi All,

I have downloaded the ADT and started doing my Hello World project.
I have added nothing to the project, apart from what Eclipse will create by 
default i.e. the main activity is there, which will display text.

When I run the project as Android Application, the emulator opens up, but 
the actual project does not appear at all.
I waited very long time, I can see a glowing ANDROID logo on there... but 
hat it.

In the thousands of lines displayed in the Console, I can see these lines

[2014-03-22 19:51:38 - ddms] Got reply 'FAIL', diag='closed'
[2014-03-22 19:51:38 - DeviceMonitor] Adb rejected connection to client 
'425': closed
[2014-03-22 19:51:38 - ddms] Got reply 'FAIL', diag='closed'
[2014-03-22 19:51:38 - DeviceMonitor] Adb rejected connection to client 
'440': closed
[2014-03-22 19:51:38 - ddms] Got reply 'FAIL', diag='closed'
[2014-03-22 19:51:38 - DeviceMonitor] Adb rejected connection to client 
'541': closed
[2014-03-22 19:51:38 - ddms] Got reply 'FAIL', diag='closed'
[2014-03-22 19:51:38 - DeviceMonitor] Adb rejected connection to client 
'454': closed
[2014-03-22 19:51:39 - ddms] Got reply 'FAIL', diag='closed'
[2014-03-22 19:51:39 - DeviceMonitor] Adb rejected connection to client 
'440': closed
[2014-03-22 19:51:39 - ddms] Got reply 'FAIL', diag='closed'
[2014-03-22 19:51:39 - DeviceMonitor] Adb rejected connection to client 
'541': closed
[2014-03-22 19:51:39 - ddms] Got reply 'FAIL', diag='closed'

Is this the reason of my app not appearing? What else can be the reason?
Please help.

Thanks in advance.

-- 
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
--- 
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.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Cannot get the initial SDK setup working, nightmare

2013-04-02 Thread NewToAndroid
Hi All,

I am on a Windows Vista (32 bit) laptop, using Java version 1.6.0_29. I 
downloaded the Android SDK ADT Bundle from developer.android.com. I am 
under impression that, I need not do any other setup/installation when I am 
using the bundle. Using a Windows account which is administrator. Created 
the basic Hallo World App which is shown here 
http://developer.android.com/training/basics/firstapp/creating-project.html; 
. Now trying to run it on emulator, which is proving to be a nightmare (so 
much so that, I am on the verge of giving up learning Android development).
1) When I run the application, should the emulator be already running? or 
Eclipse will start it?
2) When I click on Run - Run or Run - Run as - Android Application, 
nothing happens, no prompts, no messages on console, nothing. I am not sure 
if I should wait for something to happen or there is something missing?
3) Emulator is already running. Clicked on Run - Run. Nothing happened

Are there any configurations, parameters, which need to be done before I 
try to run the project?

Thanks in advance

-- 
-- 
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
--- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Unfortunately the activity has stopped

2012-01-26 Thread newtoandroid
i tried a simple login page which gets the gps location if the login
condition is satisfied,while running it shows ünfortunately,the
activity has stopped with an ok button. i have created the avd with
gps support supporting android 4 with google Inc and even set the gps
manually in ddms perspective.here is my launcher activity.
package com.first;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class FirstActivity extends Activity {
EditText txtUserName;
EditText txtPassword;
Button btnLogin;
Button btnCancel;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final Context context=this;
 
txtUserName=(EditText)this.findViewById(R.id.txtUname);
txtPassword=(EditText)this.findViewById(R.id.txtPwd);
btnLogin=(Button)this.findViewById(R.id.btnLogin);
btnLogin=(Button)this.findViewById(R.id.btnLogin);
btnLogin.setOnClickListener(new OnClickListener() {

public void onClick(View v) {
// TODO Auto-generated method stub

 
if((txtUserName.getText().toString()).equals(txtPassword.getText().toString()))
{

Toast.makeText(FirstActivity.this, Login
Successful,Toast.LENGTH_LONG).show();

Intent i=new Intent(context,com.first.LbsGeocoding.class);
startActivityForResult(i,0);
FirstActivity.this.finish();} else{
   Toast.makeText(FirstActivity.this, Invalid
Login,Toast.LENGTH_LONG).show();
  }

   }
  });


}}

-- 
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] viewing source code

2011-12-02 Thread newtoandroid
hii
how could i view the sourcecode of an 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