[android-developers] Download manager android tv

2016-08-17 Thread Cristian Ortiz Ramírez
Hi guys.

 I'm new to android development I'm working now in an application that 
implements AndroidManager class but I'm facing some issue when I emulate my 
app in android tv device.

What I want to do is download a video from a url and when download finishes 
show de downloaded video on a VideoView, the problem here is that when I 
emulate on android TV the DownloadManager does not work, and if a try any 
other emulator(phone, tablet) it works like a charm. I've added everything 
that it's necessary in the Manifest to run on android tv, but no success.

Hope you could help me 

-- 
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/df24c5bb-49d9-459d-9cf4-a34109583e30%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] Download Manager: Pause & Resume

2016-06-10 Thread himanshu
Ok thank you.  For now, because of lack of pause/resume, I'll have to stick 
with stop/recreate. 

On Monday, June 6, 2016 at 11:31:31 AM UTC+5:30, TreKing wrote:
>
>
> On Fri, Jun 3, 2016 at 4:28 AM, himanshu  > wrote:
>
>> Actually its not a public API of DownloadManager. 
>
>
> Then it seems you're relying on unofficial behavior, which would indicate 
> this is not necessarily a bug, since it's likely not intended to be used 
> this way.
>
> Sorry, don't really have an answer for you on how to achieve what you're 
> looking for, but it doesn't appear to be a bug, per se.
>
>
> -
> TreKing  - Chicago 
> transit tracking app for Android-powered devices
>

-- 
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/9a8346d0-db26-4777-b110-cb5ddb544176%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] Download Manager: Pause & Resume

2016-06-05 Thread TreKing
On Fri, Jun 3, 2016 at 4:28 AM, himanshu 
wrote:

> Actually its not a public API of DownloadManager.


Then it seems you're relying on unofficial behavior, which would indicate
this is not necessarily a bug, since it's likely not intended to be used
this way.

Sorry, don't really have an answer for you on how to achieve what you're
looking for, but it doesn't appear to be a bug, per se.

-
TreKing  - Chicago
transit tracking app for Android-powered devices

-- 
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/CANCScgjtDtkHq0r2xaqXVULmvg0tSJSH75q8_D3DXz75x%2BzFXg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] Download Manager: Pause & Resume

2016-06-03 Thread himanshu
Actually its not a public API of DownloadManager. 

DownloadProvider documentation 

 ( 
and platform code  
)
 
clearly indicates that COLUMN_CONTROL is for pausing and resuming from 
Apps. 

And on setting COLUMN_CONTROL to CONTROL_PAUSED (1)  leads to pausing ( 
initially that column is null when I read it before setting it to 
CONTROL_PAUSED) .
And after that, I see that after sometime COLUMN_STATUS is set to 
STATUS_PAUSED_BY_APP

Also COLUMN_CURRENT_BYTES  stops updating, so that indicates that pausing 
works. 

Next when I want to resume, I set COLUMN_CONTROL to CONTROL_RUN. But it 
stays in that state, without getting resumed. 


On Thursday, June 2, 2016 at 11:22:25 PM UTC+5:30, TreKing wrote:
>
>
> On Wed, Jun 1, 2016 at 2:29 PM, himanshu  > wrote:
>
>> I'm able to Pause a download by setting COLUMN_CONTROL to CONTROL_PAUSED 
>
>
> Where in the API does it indicate that this is how you pause a download?
>
>
> -
> TreKing  - Chicago 
> transit tracking app for Android-powered devices
>

-- 
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/6039645c-d211-4b18-9d22-4eb31a0a8a64%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] Download Manager: Pause & Resume

2016-06-02 Thread TreKing
On Wed, Jun 1, 2016 at 2:29 PM, himanshu 
wrote:

> I'm able to Pause a download by setting COLUMN_CONTROL to CONTROL_PAUSED


Where in the API does it indicate that this is how you pause a download?

-
TreKing  - Chicago
transit tracking app for Android-powered devices

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


[android-developers] Download Manager: Pause & Resume

2016-06-01 Thread himanshu
I'm able to Pause a download by setting COLUMN_CONTROL to CONTROL_PAUSED 
But when I resume a download by setting COLUMN_CONTROL to CONTROL_RUN, *it 
doesn't work*. 
The download stays in paused state. 

Is that a bug ?


More info: 

CONTENT_URI for update: content://downloads/my_download/ 




-- 
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/5a412385-a641-46fb-ad08-4b65eef16a38%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Download Manager : Getting Exception while getting Coloumn Index for local file name of downloaded file

2012-12-08 Thread vivek singh
   
 There is an activity in my android application which checks for the latest 
version of app
on app's server. When it finds a new version of the app, it initiates a 
download process of the apk file using DownloadManager. When activity 
receives the message that the application is downloaded, it tries to open 
the downloaded file. And when the apk file is opened, the installation 
process is automatically started.

Here is the code of my BroadCastReceiver:

   BroadcastReceiver broad= new BroadcastReceiver(){
  @Override
  public void onReceive(Context con,Intent inxc)
  {String sact=inxc.getAction();
   if(DownloadManager.ACTION_DOWNLOAD_COMPLETE.equals(sact))
{
 Query qer=new Query();
 qer.setFilterById(dloadid);
 final Cursor curr=dloadm.query(qer);
 if(curr.moveToFirst())
 {int 
cind=curr.getColumnIndex(DownloadManager.COLUMN_STATUS);
  
if(DownloadManager.STATUS_SUCCESSFUL==curr.getInt(cind))
  {final AlertDialog instd=new 
AlertDialog.Builder(fze).create();
   instd.setTitle(Test app );
   instd.setMessage(New apk for 
application Downloaded.\n Would you like to install it now);
   instd.setButton(-1,Yes,new 
DialogInterface.OnClickListener(){
   @Override
  public void onClick(DialogInterface 
dface,int fox)
   {/*EXCEPTION OCCURRED IN 
FOLLOWING LINE*/
String 
apkloc=curr.getString(curr.getColumnIndex(DownloadManager.COLUMN_LOCAL_FILENAME));
Intent installapk=new 
Intent(Intent.ACTION_VIEW);

installapk.setDataAndType(Uri.fromFile(new File(apkloc)), 
application/vnd.android.package-archive);
startActivity(installapk);
  }
   });
   instd.setButton(-3,No, new 
DialogInterface.OnClickListener(){
  @Override
  public void onClick(DialogInterface 
dface,int fox)
  {
 instd.dismiss();
  }
   });
   instd.show();
  }

 }
}

  }
 };


**This code is working fine.**

But recently I received some users' feedback mentioning they received 
Unfortunately Activity Stopped... message .

StackTrace


 java.lang.IllegalArgumentException: Invalid column index -1, 12 
columns exist
at 
android.app.DownloadManager$CursorTranslator.getColumnName(DownloadManager.java:1261)
at 
android.app.DownloadManager$CursorTranslator.getString(DownloadManager.java:1315)
at com.android.testdl.Fview$2$1.onClick(AppTest.java:146)
at 
com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:165)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3691)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)
at dalvik.system.NativeStart.main(Native Method)

Any suggestions?

All users who received this error messages were not on WI-FI connection. 
They were on mobile network.

-- 
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] Download manager

2009-05-04 Thread davidyu

   I want to access Download manager in my application, and set
   uses-permission
android:name=android.permission.ACCESS_DOWNLOAD_MANAGER/
   uses-permission
android:name=android.permission.ACCESS_DOWNLOAD_MANAGER_ADVANCED/
   uses-permission
android:name=android.permission.ACCESS_CACHE_FILESYSTEM/
   uses-permission
android:name=android.permission.SEND_DOWNLOAD_COMPLETED_INTENTS/

 in manifest.xml

  However, I still get /AndroidRuntime(14300): Caused by:
java.lang.SecurityException: Permission Denial: reading
com.android.providers.downloads.DownloadProvider uri
content://downloads/download from pid=14300, uid=10057 requires
android.permission.ACCESS_DOWNLOAD_MANAGER
E/AndroidRuntime(14300):at android.os.Parcel.readException
(Parcel.java:1234)
E/AndroidRuntime(14300):at
android.database.DatabaseUtils.readExceptionFromParcel
(DatabaseUtils.java:145)
E/AndroidRuntime(14300):at
android.database.DatabaseUtils.readExceptionFromParcel
(DatabaseUtils.java:111)
E/AndroidRuntime(14300):at
android.content.ContentProviderProxy.bulkQuery
(ContentProviderNative.java:279)
E/AndroidRuntime(14300):at
android.content.ContentProviderProxy.query(ContentProviderNative.java:
298)
E/AndroidRuntime(14300):at
android.content.ContentResolver.query(ContentResolver.java:149)
E/AndroidRuntime(14300):at
android.app.Activity.managedQuery(Activity.java:1499)

is there anything else I should do to access Download Manager?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---