[android-developers] Re: How to store videos with similar naming scheme as stock camera, but in custom camera app

2015-12-31 Thread David Karr
A negative confirmation is better than nothing, so thanks for that.  At 
least I don't have to try any more variations of the scanner code.

On Tuesday, December 29, 2015 at 12:17:23 AM UTC-8, gjs wrote:
>
> Hi,
>
> I don't think you'll get the confirmation you are seeking, but here's what 
> I think is currently happening.
>
> (1) The (Google) Gallery app is no more, now being replaced by the 
> (Google) Photos app.
>
> (2) Currently the (Google) Photos app appears to ignore the 
> MediaScannerConnection calls and / or does not query the associated Media 
> repository (/database) where media metadata is cataloged nor listen or act 
> on any associated Content Providers etc.
>
> (3) The (Google) Photos app currently seems heavily invested in using 
> (Google) cloud storage to backup and sync all your photos from all your 
> devices mobile & desktop. From some tests undertaken just now I've found 
> that photos from third party app won't show up in the (Google) Photos app 
> unless you explicitly turn on sync'ing and backup (via its settings) 
> and explicitly select your third party app media folder(s). You 
> won't necessarily see photos taken very recently (with 3rd party app) in 
> the main photo view and you might see these in the Device Folders view (on 
> some devices), eg: I can see a recent photo taken on a Nexus 6P, but I 
> can't yet on an Xperia Z5.
>
> (4) The (Google) Photos app is overly ambitious(?) with many moving parts, 
> seeking to do all sorts of things, grouping stories, show what you were 
> doing on this day in previous years etc etc etc, but can't get the basics 
> to work *reliably* such as show all photos on the device, sharing & getting 
> sync'ing to work consistently, (unless perhaps you only use the default 
> camera app). On the Xperia Z5 sharing a photos currently crashes 
> the (Google) Photos app... The help suggests things like turning off 
> syncing and turning it back on again when it's not working...
>
> (5) Google has a habit of consistently changing the Photos apps every few 
> months or so both on mobile and on the web, so what might work now it bound 
> to change and be broken again in future.
>
> (6) If you want to be certain that photos, videos captured with you app 
> are present on the device then you need to provide you own viewer activity 
> of some sort as previously suggest, or else be willing to help your users 
> get the (Google) Photos app configured to find photos, video created with 
> your app and be ready to do that all over again with next the (Google) 
> Photo app updates.
>
> Regards
>
>
> On Tuesday, December 29, 2015 at 6:37:32 AM UTC+11, David Karr wrote:
>>
>> I'm still hoping to get some help with this.  I've made no progress on 
>> this.
>>
>> I've yet to get any confirmation that something like this can even do 
>> what I think it's supposed to do, which is make videos recorded by a custom 
>> app be visible by the "Photos" or "Gallery" app, as if they were recorded 
>> by the stock app.  What I've read implies that this will happen, but I've 
>> yet to have this confirmed.
>>
>> The versions of this that I've tried both call the "completed" callback 
>> (except for the simple "sendBroadcast" variation), but that's the only 
>> indication I get that the process did anything.  Despite the "completed" 
>> callback being called, the recorded videos are never visible in the 
>> "Photos" or "Gallery" app.
>>
>> On Saturday, December 19, 2015 at 9:58:02 AM UTC-8, David Karr wrote:
>>>
>>> Because I can't bring up the stock camera app with just a video 
>>> record/stop button (I'm using a remote bluetooth button to start/stop 
>>> recording), I've written a custom app that just displays the camera preview 
>>> and a video record/stop button.
>>>
>>> Despite the fact that this is a custom app, as much as possible I'd like 
>>> to store the videos as if they were taken with the stock app.  This at 
>>> least means storing them in the same place, with a consistent naming and 
>>> metadata scheme.  I might consider having custom preferences in the app, 
>>> but for now I'd just like to retrieve properties that will tell me where 
>>> the stock camera app will store videos, along with any other configuration 
>>> that should describe how I store the videos.
>>>
>>> How can I get this information within my custom app?
>>>
>>

-- 
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/997d84fa-9d06-4bab-a7ac-8b050d3d9ccc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: How to store videos with similar naming scheme as stock camera, but in custom camera app

2015-12-29 Thread gjs
Hi,

I don't think you'll get the confirmation you are seeking, but here's what 
I think is currently happening.

(1) The (Google) Gallery app is no more, now being replaced by the (Google) 
Photos app.

(2) Currently the (Google) Photos app appears to ignore the 
MediaScannerConnection calls and / or does not query the associated Media 
repository (/database) where media metadata is cataloged nor listen or act 
on any associated Content Providers etc.

(3) The (Google) Photos app currently seems heavily invested in using 
(Google) cloud storage to backup and sync all your photos from all your 
devices mobile & desktop. From some tests undertaken just now I've found 
that photos from third party app won't show up in the (Google) Photos app 
unless you explicitly turn on sync'ing and backup (via its settings) 
and explicitly select your third party app media folder(s). You 
won't necessarily see photos taken very recently (with 3rd party app) in 
the main photo view and you might see these in the Device Folders view (on 
some devices), eg: I can see a recent photo taken on a Nexus 6P, but I 
can't yet on an Xperia Z5.

(4) The (Google) Photos app is overly ambitious(?) with many moving parts, 
seeking to do all sorts of things, grouping stories, show what you were 
doing on this day in previous years etc etc etc, but can't get the basics 
to work *reliably* such as show all photos on the device, sharing & getting 
sync'ing to work consistently, (unless perhaps you only use the default 
camera app). On the Xperia Z5 sharing a photos currently crashes 
the (Google) Photos app... The help suggests things like turning off 
syncing and turning it back on again when it's not working...

(5) Google has a habit of consistently changing the Photos apps every few 
months or so both on mobile and on the web, so what might work now it bound 
to change and be broken again in future.

(6) If you want to be certain that photos, videos captured with you app are 
present on the device then you need to provide you own viewer activity of 
some sort as previously suggest, or else be willing to help your users get 
the (Google) Photos app configured to find photos, video created with your 
app and be ready to do that all over again with next the (Google) Photo app 
updates.

Regards


On Tuesday, December 29, 2015 at 6:37:32 AM UTC+11, David Karr wrote:
>
> I'm still hoping to get some help with this.  I've made no progress on 
> this.
>
> I've yet to get any confirmation that something like this can even do what 
> I think it's supposed to do, which is make videos recorded by a custom app 
> be visible by the "Photos" or "Gallery" app, as if they were recorded by 
> the stock app.  What I've read implies that this will happen, but I've yet 
> to have this confirmed.
>
> The versions of this that I've tried both call the "completed" callback 
> (except for the simple "sendBroadcast" variation), but that's the only 
> indication I get that the process did anything.  Despite the "completed" 
> callback being called, the recorded videos are never visible in the 
> "Photos" or "Gallery" app.
>
> On Saturday, December 19, 2015 at 9:58:02 AM UTC-8, David Karr wrote:
>>
>> Because I can't bring up the stock camera app with just a video 
>> record/stop button (I'm using a remote bluetooth button to start/stop 
>> recording), I've written a custom app that just displays the camera preview 
>> and a video record/stop button.
>>
>> Despite the fact that this is a custom app, as much as possible I'd like 
>> to store the videos as if they were taken with the stock app.  This at 
>> least means storing them in the same place, with a consistent naming and 
>> metadata scheme.  I might consider having custom preferences in the app, 
>> but for now I'd just like to retrieve properties that will tell me where 
>> the stock camera app will store videos, along with any other configuration 
>> that should describe how I store the videos.
>>
>> How can I get this information within my custom app?
>>
>

-- 
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/ecec11fb-f2f3-4468-b634-605d540babc4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: How to store videos with similar naming scheme as stock camera, but in custom camera app

2015-12-28 Thread David Karr
I'm still hoping to get some help with this.  I've made no progress on this.

I've yet to get any confirmation that something like this can even do what 
I think it's supposed to do, which is make videos recorded by a custom app 
be visible by the "Photos" or "Gallery" app, as if they were recorded by 
the stock app.  What I've read implies that this will happen, but I've yet 
to have this confirmed.

The versions of this that I've tried both call the "completed" callback 
(except for the simple "sendBroadcast" variation), but that's the only 
indication I get that the process did anything.  Despite the "completed" 
callback being called, the recorded videos are never visible in the 
"Photos" or "Gallery" app.

On Saturday, December 19, 2015 at 9:58:02 AM UTC-8, David Karr wrote:
>
> Because I can't bring up the stock camera app with just a video 
> record/stop button (I'm using a remote bluetooth button to start/stop 
> recording), I've written a custom app that just displays the camera preview 
> and a video record/stop button.
>
> Despite the fact that this is a custom app, as much as possible I'd like 
> to store the videos as if they were taken with the stock app.  This at 
> least means storing them in the same place, with a consistent naming and 
> metadata scheme.  I might consider having custom preferences in the app, 
> but for now I'd just like to retrieve properties that will tell me where 
> the stock camera app will store videos, along with any other configuration 
> that should describe how I store the videos.
>
> How can I get this information within my custom app?
>

-- 
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/2dc51302-2247-43b2-8577-2771956a02ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: How to store videos with similar naming scheme as stock camera, but in custom camera app

2015-12-23 Thread David Karr
On Tuesday, December 22, 2015 at 10:33:17 AM UTC-8, David Karr wrote:
>
> On Tuesday, December 22, 2015 at 12:49:55 AM UTC-8, gjs wrote:
>>
>> Hi,
>>
>> MediaScannerConnection scanFile() (& the equivalent Intent), is just a 
>> request to the OS, it does provide an on completion listener to let you 
>> know when it is finished the request, but that doesn't necessarily mean it 
>> actually or immediately performs the 'scanning' for you request, it might 
>> defer or ignore it. (Once upon a time it did scan when requested, but you'd 
>> need to read recent Android OS Source code / Photos app source code to be 
>> certain).
>>
>> Proving your own media viewer activity or using an Intent to open the 
>> media file or showing the image capture briefly or as a thumbnail is 
>> usually what done to provide immediate feedback.
>>
>
> My intention was to do something that would make the "Photos" app see my 
> stored videos.  This (MediaScannerConnection) doesn't appear to be doing 
> it, and I haven't seen any real confirmation that it's even supposed to do 
> it.  What is the point of doing this?  I'm going to guess that if I just 
> change the subdir name I write to to "Camera", then "Photos" will see my 
> videos.
>

Unfortunately,  my guess was wrong.  I changed  the subdir from the custom 
name for my app to "Camera".  It stored the video in that folder, along 
with the pictures and videos from the stock app, but the videos from my 
custom app are still not visible in the Photos or Gallery app.

I've tried both the "sendBroadcast" and more verbose 
"MediaScannerConnection.scanFile()" approach.  Neither of these fail, and 
the latter does call the "onScanCompleted" callback, but neither of these 
seem to do anything.

Any ideas?

 
>
>>
>> Regards
>>
>>
>> On Tuesday, December 22, 2015 at 5:29:36 AM UTC+11, David Karr wrote:
>>>
>>> On Monday, December 21, 2015 at 12:08:57 AM UTC-8, gjs wrote:

 Hi,

 If your phone is not a Google Nexus variety then that's not surprising, 
 but Environment.getExternalStoragePublicDirectory(Environment.
 DIRECTORY_DCIM) is what's recommended.

 In some respects it does not really matter which folder you use to 
 store media generated by your app (*), provided you go to the trouble of 
 'cataloging' the media generated using MediaScannerConnection - 
 http://developer.android.com/reference/android/media/MediaScannerConnection.html#scanFile(android.content.Context,
  
 java.lang.String[], java.lang.String[], 
 android.media.MediaScannerConnection.OnScanCompletedListener) then your 
 photos / video will quickly show up in the default 'Photos' app, without 
 having to wait for it to scan the device periodically to find new media 
 files.

 (*) And is some other respects it really, really does matter what 
 folder you use - if you don't want the media files deleted when your app 
 in 
 uninstalled (!) Be very careful about what you decide, here's some 
 'interesting' history - 
 https://groups.google.com/forum/#!topic/android-platform/14VUiIgwUjY%5B1-25%5D

 Regards


>>> Ok, following this information and some other advice (I created a custom 
>>> subdir of "DCIM" for my app), I ended up with the following:
>>>
>>> sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, 
>>> Uri.parse("file://" + outputFilePath)));
>>>
>>>
>>>  The problem is, it's not clear to me that this is doing anything.  
>>> After storing one of these and calling this, I exit my app and run the 
>>> Photos app, and the new video is not shown there.  I've verified that the 
>>> video is stored and viewable.
>>>
>>> On Monday, December 21, 2015 at 5:53:49 AM UTC+11, David Karr wrote:
>
> On Saturday, December 19, 2015 at 10:34:46 PM UTC-8, gjs wrote:
>>
>> Hi,
>>
>> See 
>> http://developer.android.com/reference/android/os/Environment.html 
>> it has methods to retrieve default paths of where photo, video files etc 
>> are stored.
>>
>> The file naming convention should be easy enough to mimic, usually 
>> being based on date time stamps.
>>
>
> Thanks.  That gets pretty close.  I'm having trouble getting it to 
> match what my phone is using.  For the directory expression, I'm 
> currently 
> using this:
>
> Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM)
>
>
> However, on my phone, the actual place where it stores pictures from 
> the stock camera is in a "Camera" subdirectory.  This expression doesn't 
> include that.  I could hardcode that, but doesn't feel right.  I tried 
> some 
> variations of this, but I never found an expression that returns "Camera" 
> as the base directory name.
>
>>
>> Regards
>>
>> On Sunday, December 20, 2015 at 4:58:02 AM UTC+11, David Karr wrote:
>>>
>>> Because I can't bring up the stock camera 

[android-developers] Re: How to store videos with similar naming scheme as stock camera, but in custom camera app

2015-12-22 Thread David Karr
On Tuesday, December 22, 2015 at 12:49:55 AM UTC-8, gjs wrote:
>
> Hi,
>
> MediaScannerConnection scanFile() (& the equivalent Intent), is just a 
> request to the OS, it does provide an on completion listener to let you 
> know when it is finished the request, but that doesn't necessarily mean it 
> actually or immediately performs the 'scanning' for you request, it might 
> defer or ignore it. (Once upon a time it did scan when requested, but you'd 
> need to read recent Android OS Source code / Photos app source code to be 
> certain).
>
> Proving your own media viewer activity or using an Intent to open the 
> media file or showing the image capture briefly or as a thumbnail is 
> usually what done to provide immediate feedback.
>

My intention was to do something that would make the "Photos" app see my 
stored videos.  This (MediaScannerConnection) doesn't appear to be doing 
it, and I haven't seen any real confirmation that it's even supposed to do 
it.  What is the point of doing this?  I'm going to guess that if I just 
change the subdir name I write to to "Camera", then "Photos" will see my 
videos.
 

>
> Regards
>
>
> On Tuesday, December 22, 2015 at 5:29:36 AM UTC+11, David Karr wrote:
>>
>> On Monday, December 21, 2015 at 12:08:57 AM UTC-8, gjs wrote:
>>>
>>> Hi,
>>>
>>> If your phone is not a Google Nexus variety then that's not surprising, 
>>> but Environment.getExternalStoragePublicDirectory(Environment.
>>> DIRECTORY_DCIM) is what's recommended.
>>>
>>> In some respects it does not really matter which folder you use to store 
>>> media generated by your app (*), provided you go to the trouble of 
>>> 'cataloging' the media generated using MediaScannerConnection - 
>>> http://developer.android.com/reference/android/media/MediaScannerConnection.html#scanFile(android.content.Context,
>>>  
>>> java.lang.String[], java.lang.String[], 
>>> android.media.MediaScannerConnection.OnScanCompletedListener) then your 
>>> photos / video will quickly show up in the default 'Photos' app, without 
>>> having to wait for it to scan the device periodically to find new media 
>>> files.
>>>
>>> (*) And is some other respects it really, really does matter what folder 
>>> you use - if you don't want the media files deleted when your app in 
>>> uninstalled (!) Be very careful about what you decide, here's some 
>>> 'interesting' history - 
>>> https://groups.google.com/forum/#!topic/android-platform/14VUiIgwUjY%5B1-25%5D
>>>
>>> Regards
>>>
>>>
>> Ok, following this information and some other advice (I created a custom 
>> subdir of "DCIM" for my app), I ended up with the following:
>>
>> sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, 
>> Uri.parse("file://" + outputFilePath)));
>>
>>
>>  The problem is, it's not clear to me that this is doing anything.  After 
>> storing one of these and calling this, I exit my app and run the Photos 
>> app, and the new video is not shown there.  I've verified that the video is 
>> stored and viewable.
>>
>> On Monday, December 21, 2015 at 5:53:49 AM UTC+11, David Karr wrote:

 On Saturday, December 19, 2015 at 10:34:46 PM UTC-8, gjs wrote:
>
> Hi,
>
> See http://developer.android.com/reference/android/os/Environment.html 
> it has methods to retrieve default paths of where photo, video files etc 
> are stored.
>
> The file naming convention should be easy enough to mimic, usually 
> being based on date time stamps.
>

 Thanks.  That gets pretty close.  I'm having trouble getting it to 
 match what my phone is using.  For the directory expression, I'm currently 
 using this:

 Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM)


 However, on my phone, the actual place where it stores pictures from 
 the stock camera is in a "Camera" subdirectory.  This expression doesn't 
 include that.  I could hardcode that, but doesn't feel right.  I tried 
 some 
 variations of this, but I never found an expression that returns "Camera" 
 as the base directory name.

>
> Regards
>
> On Sunday, December 20, 2015 at 4:58:02 AM UTC+11, David Karr wrote:
>>
>> Because I can't bring up the stock camera app with just a video 
>> record/stop button (I'm using a remote bluetooth button to start/stop 
>> recording), I've written a custom app that just displays the camera 
>> preview 
>> and a video record/stop button.
>>
>> Despite the fact that this is a custom app, as much as possible I'd 
>> like to store the videos as if they were taken with the stock app.  This 
>> at 
>> least means storing them in the same place, with a consistent naming and 
>> metadata scheme.  I might consider having custom preferences in the app, 
>> but for now I'd just like to retrieve properties that will tell me where 
>> the stock camera app will store videos, along with any other 
>> 

[android-developers] Re: How to store videos with similar naming scheme as stock camera, but in custom camera app

2015-12-22 Thread gjs
Hi,

MediaScannerConnection scanFile() (& the equivalent Intent), is just a 
request to the OS, it does provide an on completion listener to let you 
know when it is finished the request, but that doesn't necessarily mean it 
actually or immediately performs the 'scanning' for you request, it might 
defer or ignore it. (Once upon a time it did scan when requested, but you'd 
need to read recent Android OS Source code / Photos app source code to be 
certain).

Proving your own media viewer activity or using an Intent to open the media 
file or showing the image capture briefly or as a thumbnail is usually what 
done to provide immediate feedback.

Regards


On Tuesday, December 22, 2015 at 5:29:36 AM UTC+11, David Karr wrote:
>
> On Monday, December 21, 2015 at 12:08:57 AM UTC-8, gjs wrote:
>>
>> Hi,
>>
>> If your phone is not a Google Nexus variety then that's not surprising, 
>> but Environment.getExternalStoragePublicDirectory(Environment.
>> DIRECTORY_DCIM) is what's recommended.
>>
>> In some respects it does not really matter which folder you use to store 
>> media generated by your app (*), provided you go to the trouble of 
>> 'cataloging' the media generated using MediaScannerConnection - 
>> http://developer.android.com/reference/android/media/MediaScannerConnection.html#scanFile(android.content.Context,
>>  
>> java.lang.String[], java.lang.String[], 
>> android.media.MediaScannerConnection.OnScanCompletedListener) then your 
>> photos / video will quickly show up in the default 'Photos' app, without 
>> having to wait for it to scan the device periodically to find new media 
>> files.
>>
>> (*) And is some other respects it really, really does matter what folder 
>> you use - if you don't want the media files deleted when your app in 
>> uninstalled (!) Be very careful about what you decide, here's some 
>> 'interesting' history - 
>> https://groups.google.com/forum/#!topic/android-platform/14VUiIgwUjY%5B1-25%5D
>>
>> Regards
>>
>>
> Ok, following this information and some other advice (I created a custom 
> subdir of "DCIM" for my app), I ended up with the following:
>
> sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, 
> Uri.parse("file://" + outputFilePath)));
>
>
>  The problem is, it's not clear to me that this is doing anything.  After 
> storing one of these and calling this, I exit my app and run the Photos 
> app, and the new video is not shown there.  I've verified that the video is 
> stored and viewable.
>
> On Monday, December 21, 2015 at 5:53:49 AM UTC+11, David Karr wrote:
>>>
>>> On Saturday, December 19, 2015 at 10:34:46 PM UTC-8, gjs wrote:

 Hi,

 See http://developer.android.com/reference/android/os/Environment.html 
 it has methods to retrieve default paths of where photo, video files etc 
 are stored.

 The file naming convention should be easy enough to mimic, usually 
 being based on date time stamps.

>>>
>>> Thanks.  That gets pretty close.  I'm having trouble getting it to match 
>>> what my phone is using.  For the directory expression, I'm currently using 
>>> this:
>>>
>>> Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM)
>>>
>>>
>>> However, on my phone, the actual place where it stores pictures from the 
>>> stock camera is in a "Camera" subdirectory.  This expression doesn't 
>>> include that.  I could hardcode that, but doesn't feel right.  I tried some 
>>> variations of this, but I never found an expression that returns "Camera" 
>>> as the base directory name.
>>>

 Regards

 On Sunday, December 20, 2015 at 4:58:02 AM UTC+11, David Karr wrote:
>
> Because I can't bring up the stock camera app with just a video 
> record/stop button (I'm using a remote bluetooth button to start/stop 
> recording), I've written a custom app that just displays the camera 
> preview 
> and a video record/stop button.
>
> Despite the fact that this is a custom app, as much as possible I'd 
> like to store the videos as if they were taken with the stock app.  This 
> at 
> least means storing them in the same place, with a consistent naming and 
> metadata scheme.  I might consider having custom preferences in the app, 
> but for now I'd just like to retrieve properties that will tell me where 
> the stock camera app will store videos, along with any other 
> configuration 
> that should describe how I store the videos.
>
> How can I get this information within my custom app?
>


-- 
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 

[android-developers] Re: How to store videos with similar naming scheme as stock camera, but in custom camera app

2015-12-21 Thread David Karr
On Monday, December 21, 2015 at 12:08:57 AM UTC-8, gjs wrote:
>
> Hi,
>
> If your phone is not a Google Nexus variety then that's not surprising, but
>  Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM) 
> is what's recommended.
>
> In some respects it does not really matter which folder you use to store 
> media generated by your app (*), provided you go to the trouble of 
> 'cataloging' the media generated using MediaScannerConnection - 
> http://developer.android.com/reference/android/media/MediaScannerConnection.html#scanFile(android.content.Context,
>  
> java.lang.String[], java.lang.String[], 
> android.media.MediaScannerConnection.OnScanCompletedListener) then your 
> photos / video will quickly show up in the default 'Photos' app, without 
> having to wait for it to scan the device periodically to find new media 
> files.
>
> (*) And is some other respects it really, really does matter what folder 
> you use - if you don't want the media files deleted when your app in 
> uninstalled (!) Be very careful about what you decide, here's some 
> 'interesting' history - 
> https://groups.google.com/forum/#!topic/android-platform/14VUiIgwUjY%5B1-25%5D
>
> Regards
>
>
Ok, following this information and some other advice (I created a custom 
subdir of "DCIM" for my app), I ended up with the following:

sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, 
Uri.parse("file://" + outputFilePath)));


 The problem is, it's not clear to me that this is doing anything.  After 
storing one of these and calling this, I exit my app and run the Photos 
app, and the new video is not shown there.  I've verified that the video is 
stored and viewable.

On Monday, December 21, 2015 at 5:53:49 AM UTC+11, David Karr wrote:
>>
>> On Saturday, December 19, 2015 at 10:34:46 PM UTC-8, gjs wrote:
>>>
>>> Hi,
>>>
>>> See http://developer.android.com/reference/android/os/Environment.html 
>>> it has methods to retrieve default paths of where photo, video files etc 
>>> are stored.
>>>
>>> The file naming convention should be easy enough to mimic, usually being 
>>> based on date time stamps.
>>>
>>
>> Thanks.  That gets pretty close.  I'm having trouble getting it to match 
>> what my phone is using.  For the directory expression, I'm currently using 
>> this:
>>
>> Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM)
>>
>>
>> However, on my phone, the actual place where it stores pictures from the 
>> stock camera is in a "Camera" subdirectory.  This expression doesn't 
>> include that.  I could hardcode that, but doesn't feel right.  I tried some 
>> variations of this, but I never found an expression that returns "Camera" 
>> as the base directory name.
>>
>>>
>>> Regards
>>>
>>> On Sunday, December 20, 2015 at 4:58:02 AM UTC+11, David Karr wrote:

 Because I can't bring up the stock camera app with just a video 
 record/stop button (I'm using a remote bluetooth button to start/stop 
 recording), I've written a custom app that just displays the camera 
 preview 
 and a video record/stop button.

 Despite the fact that this is a custom app, as much as possible I'd 
 like to store the videos as if they were taken with the stock app.  This 
 at 
 least means storing them in the same place, with a consistent naming and 
 metadata scheme.  I might consider having custom preferences in the app, 
 but for now I'd just like to retrieve properties that will tell me where 
 the stock camera app will store videos, along with any other configuration 
 that should describe how I store the videos.

 How can I get this information within my custom app?

>>>

-- 
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/1fee646d-729f-44de-8f22-d967d14c7e34%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: How to store videos with similar naming scheme as stock camera, but in custom camera app

2015-12-21 Thread gjs
Hi again,

Actually ../DCIM/Camera is the expected sub folder for the default Camera 
app, my apologies.

What I've seen on some devices is that different apps will create 
additional subfolders beneath ../DCIM for example the Google Cardboard 
Camera app creates ../DCIM/CardboardCamera

On a Non Google Nexus phone device I see -

../DCIM/100ANDRO
../DCIM/Camera
../DCIM/CardboardCamera
../DCIM/Screenshots

- so perhaps following that convention and create your own subfolder 
beneath ../DCIM that way it is still within the expected media folder 
hierarchy and importantly your media files probably won't get deleted when 
someone uninstalls your app (!)

Regards



On Monday, December 21, 2015 at 7:11:52 PM UTC+11, gjs wrote:
>
> (That's 
> http://developer.android.com/reference/android/media/MediaScannerConnection.html
>  
> in case of a broken link...)
>
> On Monday, December 21, 2015 at 7:08:57 PM UTC+11, gjs wrote:
>>
>> Hi,
>>
>> If your phone is not a Google Nexus variety then that's not surprising, 
>> but Environment.getExternalStoragePublicDirectory(Environment.
>> DIRECTORY_DCIM) is what's recommended.
>>
>> In some respects it does not really matter which folder you use to store 
>> media generated by your app (*), provided you go to the trouble of 
>> 'cataloging' the media generated using MediaScannerConnection - 
>> http://developer.android.com/reference/android/media/MediaScannerConnection.html#scanFile(android.content.Context,
>>  
>> java.lang.String[], java.lang.String[], 
>> android.media.MediaScannerConnection.OnScanCompletedListener) then your 
>> photos / video will quickly show up in the default 'Photos' app, without 
>> having to wait for it to scan the device periodically to find new media 
>> files.
>>
>> (*) And is some other respects it really, really does matter what folder 
>> you use - if you don't want the media files deleted when your app in 
>> uninstalled (!) Be very careful about what you decide, here's some 
>> 'interesting' history - 
>> https://groups.google.com/forum/#!topic/android-platform/14VUiIgwUjY%5B1-25%5D
>>
>> Regards
>>
>>
>>
>>
>>
>> On Monday, December 21, 2015 at 5:53:49 AM UTC+11, David Karr wrote:
>>>
>>> On Saturday, December 19, 2015 at 10:34:46 PM UTC-8, gjs wrote:

 Hi,

 See http://developer.android.com/reference/android/os/Environment.html 
 it has methods to retrieve default paths of where photo, video files etc 
 are stored.

 The file naming convention should be easy enough to mimic, usually 
 being based on date time stamps.

>>>
>>> Thanks.  That gets pretty close.  I'm having trouble getting it to match 
>>> what my phone is using.  For the directory expression, I'm currently using 
>>> this:
>>>
>>> Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM)
>>>
>>>
>>> However, on my phone, the actual place where it stores pictures from the 
>>> stock camera is in a "Camera" subdirectory.  This expression doesn't 
>>> include that.  I could hardcode that, but doesn't feel right.  I tried some 
>>> variations of this, but I never found an expression that returns "Camera" 
>>> as the base directory name.
>>>

 Regards

 On Sunday, December 20, 2015 at 4:58:02 AM UTC+11, David Karr wrote:
>
> Because I can't bring up the stock camera app with just a video 
> record/stop button (I'm using a remote bluetooth button to start/stop 
> recording), I've written a custom app that just displays the camera 
> preview 
> and a video record/stop button.
>
> Despite the fact that this is a custom app, as much as possible I'd 
> like to store the videos as if they were taken with the stock app.  This 
> at 
> least means storing them in the same place, with a consistent naming and 
> metadata scheme.  I might consider having custom preferences in the app, 
> but for now I'd just like to retrieve properties that will tell me where 
> the stock camera app will store videos, along with any other 
> configuration 
> that should describe how I store the videos.
>
> How can I get this information within my custom app?
>


-- 
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/1b67526e-5c2a-4e30-9701-c4a098bf14f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: How to store videos with similar naming scheme as stock camera, but in custom camera app

2015-12-21 Thread gjs
Hi,

If your phone is not a Google Nexus variety then that's not surprising, but 
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM) is 
what's recommended.

In some respects it does not really matter which folder you use to store 
media generated by your app (*), provided you go to the trouble of 
'cataloging' the media generated using MediaScannerConnection - 
http://developer.android.com/reference/android/media/MediaScannerConnection.html#scanFile(android.content.Context,
 
java.lang.String[], java.lang.String[], 
android.media.MediaScannerConnection.OnScanCompletedListener) then your 
photos / video will quickly show up in the default 'Photos' app, without 
having to wait for it to scan the device periodically to find new media 
files.

(*) And is some other respects it really, really does matter what folder 
you use - if you don't want the media files deleted when your app in 
uninstalled (!) Be very careful about what you decide, here's some 
'interesting' history 
- https://groups.google.com/forum/#!topic/android-platform/14VUiIgwUjY%5B1-25%5D

Regards





On Monday, December 21, 2015 at 5:53:49 AM UTC+11, David Karr wrote:
>
> On Saturday, December 19, 2015 at 10:34:46 PM UTC-8, gjs wrote:
>>
>> Hi,
>>
>> See http://developer.android.com/reference/android/os/Environment.html 
>> it has methods to retrieve default paths of where photo, video files etc 
>> are stored.
>>
>> The file naming convention should be easy enough to mimic, usually being 
>> based on date time stamps.
>>
>
> Thanks.  That gets pretty close.  I'm having trouble getting it to match 
> what my phone is using.  For the directory expression, I'm currently using 
> this:
>
> Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM)
>
>
> However, on my phone, the actual place where it stores pictures from the 
> stock camera is in a "Camera" subdirectory.  This expression doesn't 
> include that.  I could hardcode that, but doesn't feel right.  I tried some 
> variations of this, but I never found an expression that returns "Camera" 
> as the base directory name.
>
>>
>> Regards
>>
>> On Sunday, December 20, 2015 at 4:58:02 AM UTC+11, David Karr wrote:
>>>
>>> Because I can't bring up the stock camera app with just a video 
>>> record/stop button (I'm using a remote bluetooth button to start/stop 
>>> recording), I've written a custom app that just displays the camera preview 
>>> and a video record/stop button.
>>>
>>> Despite the fact that this is a custom app, as much as possible I'd like 
>>> to store the videos as if they were taken with the stock app.  This at 
>>> least means storing them in the same place, with a consistent naming and 
>>> metadata scheme.  I might consider having custom preferences in the app, 
>>> but for now I'd just like to retrieve properties that will tell me where 
>>> the stock camera app will store videos, along with any other configuration 
>>> that should describe how I store the videos.
>>>
>>> How can I get this information within my custom app?
>>>
>>

-- 
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/52f27970-6265-4a7a-8d6a-daab84c7073a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: How to store videos with similar naming scheme as stock camera, but in custom camera app

2015-12-21 Thread gjs
(That's 
http://developer.android.com/reference/android/media/MediaScannerConnection.html
 
in case of a broken link...)

On Monday, December 21, 2015 at 7:08:57 PM UTC+11, gjs wrote:
>
> Hi,
>
> If your phone is not a Google Nexus variety then that's not surprising, but
>  Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM) 
> is what's recommended.
>
> In some respects it does not really matter which folder you use to store 
> media generated by your app (*), provided you go to the trouble of 
> 'cataloging' the media generated using MediaScannerConnection - 
> http://developer.android.com/reference/android/media/MediaScannerConnection.html#scanFile(android.content.Context,
>  
> java.lang.String[], java.lang.String[], 
> android.media.MediaScannerConnection.OnScanCompletedListener) then your 
> photos / video will quickly show up in the default 'Photos' app, without 
> having to wait for it to scan the device periodically to find new media 
> files.
>
> (*) And is some other respects it really, really does matter what folder 
> you use - if you don't want the media files deleted when your app in 
> uninstalled (!) Be very careful about what you decide, here's some 
> 'interesting' history - 
> https://groups.google.com/forum/#!topic/android-platform/14VUiIgwUjY%5B1-25%5D
>
> Regards
>
>
>
>
>
> On Monday, December 21, 2015 at 5:53:49 AM UTC+11, David Karr wrote:
>>
>> On Saturday, December 19, 2015 at 10:34:46 PM UTC-8, gjs wrote:
>>>
>>> Hi,
>>>
>>> See http://developer.android.com/reference/android/os/Environment.html 
>>> it has methods to retrieve default paths of where photo, video files etc 
>>> are stored.
>>>
>>> The file naming convention should be easy enough to mimic, usually being 
>>> based on date time stamps.
>>>
>>
>> Thanks.  That gets pretty close.  I'm having trouble getting it to match 
>> what my phone is using.  For the directory expression, I'm currently using 
>> this:
>>
>> Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM)
>>
>>
>> However, on my phone, the actual place where it stores pictures from the 
>> stock camera is in a "Camera" subdirectory.  This expression doesn't 
>> include that.  I could hardcode that, but doesn't feel right.  I tried some 
>> variations of this, but I never found an expression that returns "Camera" 
>> as the base directory name.
>>
>>>
>>> Regards
>>>
>>> On Sunday, December 20, 2015 at 4:58:02 AM UTC+11, David Karr wrote:

 Because I can't bring up the stock camera app with just a video 
 record/stop button (I'm using a remote bluetooth button to start/stop 
 recording), I've written a custom app that just displays the camera 
 preview 
 and a video record/stop button.

 Despite the fact that this is a custom app, as much as possible I'd 
 like to store the videos as if they were taken with the stock app.  This 
 at 
 least means storing them in the same place, with a consistent naming and 
 metadata scheme.  I might consider having custom preferences in the app, 
 but for now I'd just like to retrieve properties that will tell me where 
 the stock camera app will store videos, along with any other configuration 
 that should describe how I store the videos.

 How can I get this information within my custom app?

>>>

-- 
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/25225bb4-5cc3-4df7-942f-ae569050b42e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: How to store videos with similar naming scheme as stock camera, but in custom camera app

2015-12-20 Thread David Karr
On Saturday, December 19, 2015 at 10:34:46 PM UTC-8, gjs wrote:
>
> Hi,
>
> See http://developer.android.com/reference/android/os/Environment.html it 
> has methods to retrieve default paths of where photo, video files etc are 
> stored.
>
> The file naming convention should be easy enough to mimic, usually being 
> based on date time stamps.
>

Thanks.  That gets pretty close.  I'm having trouble getting it to match 
what my phone is using.  For the directory expression, I'm currently using 
this:

Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM)


However, on my phone, the actual place where it stores pictures from the 
stock camera is in a "Camera" subdirectory.  This expression doesn't 
include that.  I could hardcode that, but doesn't feel right.  I tried some 
variations of this, but I never found an expression that returns "Camera" 
as the base directory name.

>
> Regards
>
> On Sunday, December 20, 2015 at 4:58:02 AM UTC+11, David Karr wrote:
>>
>> Because I can't bring up the stock camera app with just a video 
>> record/stop button (I'm using a remote bluetooth button to start/stop 
>> recording), I've written a custom app that just displays the camera preview 
>> and a video record/stop button.
>>
>> Despite the fact that this is a custom app, as much as possible I'd like 
>> to store the videos as if they were taken with the stock app.  This at 
>> least means storing them in the same place, with a consistent naming and 
>> metadata scheme.  I might consider having custom preferences in the app, 
>> but for now I'd just like to retrieve properties that will tell me where 
>> the stock camera app will store videos, along with any other configuration 
>> that should describe how I store the videos.
>>
>> How can I get this information within my custom app?
>>
>

-- 
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/925296b6-f891-4b43-b2a7-c9d2972b5757%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: How to store videos with similar naming scheme as stock camera, but in custom camera app

2015-12-19 Thread gjs
Hi,

See http://developer.android.com/reference/android/os/Environment.html it 
has methods to retrieve default paths of where photo, video files etc are 
stored.

The file naming convention should be easy enough to mimic, usually being 
based on date time stamps.

Regards

On Sunday, December 20, 2015 at 4:58:02 AM UTC+11, David Karr wrote:
>
> Because I can't bring up the stock camera app with just a video 
> record/stop button (I'm using a remote bluetooth button to start/stop 
> recording), I've written a custom app that just displays the camera preview 
> and a video record/stop button.
>
> Despite the fact that this is a custom app, as much as possible I'd like 
> to store the videos as if they were taken with the stock app.  This at 
> least means storing them in the same place, with a consistent naming and 
> metadata scheme.  I might consider having custom preferences in the app, 
> but for now I'd just like to retrieve properties that will tell me where 
> the stock camera app will store videos, along with any other configuration 
> that should describe how I store the videos.
>
> How can I get this information within my custom app?
>

-- 
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/1ca972b3-bcaa-40f9-9ac0-603f5d3a9a4c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.