[android-beginners] Re: problem wid the sdcard

2008-08-28 Thread Amin

I have added some text files in my sdcard image using "adb push ".

What I am trying to do is making a file browser for sdcard. and I can
see all the folders and files i created in my sdcard img through my
application.  Now what i want is, I want to view that text files in my
application.  Can you please tell me how can I do this?  I already
tried this

Intent myIntent = new Intent(android.content.Intent.ACTION_VIEW,
Uri.parse("file://home/sdcard.img/test.txt"));

But does not work.

Thanks

On Aug 28, 1:55 pm, "Megha Joshi" <[EMAIL PROTECTED]> wrote:
> 2008/8/28 immu <[EMAIL PROTECTED]>
>
>
>
> > Hi
> >       Thanks for u reply !!!
> >        But still i am unable to see files(jpeg/mp3) in my Emulator
> >        iam opening the Emulator with command
>
> >        emulator -sdcard 
>
> >        but no result...
>
> >        i have a doubt now , can i see those files from Emulator ?
>
> The emulator does not have a file browser...you will have to use File
> Explorer in DDMS:http://code.google.com/android/reference/ddms.html
>
>
>
> > On Aug 28, 1:54 am, "Megha Joshi" <[EMAIL PROTECTED]> wrote:
> > > Did you load the sdcard to emulator? for detailed instructions see the
> > link
> > > below:http://code.google.com/android/reference/emulator.html#sdcard
>
> > > How do you view the files in emulator?
> > > The emulator does not have a file browser...you will have to use File
> > > Explorer in DDMS:http://code.google.com/android/reference/ddms.html
>
> > > 2008/8/27 immu <[EMAIL PROTECTED]>
>
> > > > Hi
> > > >      i have add some files(jpeg/mp3) in sdcard image, but  i am
> > > > unable to see them from Emulator
>
> > > >     can any one  help me...plzz

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: problem wid the sdcard

2008-08-29 Thread Payal Amin
I tried "file:///sdcard/test.txt"  too but still it does not work... Do we
have to set any permissions or something to open a sdcard file through
application?

I think we should be able to browse the sdcard files through applications..
because in real phone when we insert an sdcard, we are able to open all kind
of files like a word file or text file.

You said i can browse the android filesystem from DDMS file explorer.  I can
browse my sdcard folders from my application.  I also created some folders
and files in sdcard through my application.  So what could be reason I am
not able to open a file? Can you please help me with this...

Thanks,

On Thu, Aug 28, 2008 at 4:23 PM, Megha Joshi <[EMAIL PROTECTED]> wrote:

>
>
> 2008/8/28 Amin <[EMAIL PROTECTED]>
>
>>
>> I have added some text files in my sdcard image using "adb push ".
>>
>> What I am trying to do is making a file browser for sdcard. and I can
>> see all the folders and files i created in my sdcard img through my
>> application.  Now what i want is, I want to view that text files in my
>> application.  Can you please tell me how can I do this?  I already
>> tried this
>>
>> Intent myIntent = new Intent(android.content.Intent.ACTION_VIEW,
>>
>>  Uri.parse("file://home/sdcard.img/test.txt"));
>>
>
> change your path to file:///sdcard/test.txt ...Android filesystem is
> different from your machine's filesystem so file://home/sdcard.img/test.txt.
> wont work.
> You can browse the android filesystem from DDMS file explorer...
>
>
>> But does not work.
>>
>> Thanks
>>
>> On Aug 28, 1:55 pm, "Megha Joshi" <[EMAIL PROTECTED]> wrote:
>> > 2008/8/28 immu <[EMAIL PROTECTED]>
>> >
>> >
>> >
>> > > Hi
>> > >   Thanks for u reply !!!
>> > >But still i am unable to see files(jpeg/mp3) in my Emulator
>> > >iam opening the Emulator with command
>> >
>> > >emulator -sdcard 
>> >
>> > >but no result...
>> >
>> > >i have a doubt now , can i see those files from Emulator ?
>> >
>> > The emulator does not have a file browser...you will have to use File
>> > Explorer in DDMS:http://code.google.com/android/reference/ddms.html
>> >
>> >
>> >
>> > > On Aug 28, 1:54 am, "Megha Joshi" <[EMAIL PROTECTED]> wrote:
>> > > > Did you load the sdcard to emulator? for detailed instructions see
>> the
>> > > link
>> > > > below:http://code.google.com/android/reference/emulator.html#sdcard
>> >
>> > > > How do you view the files in emulator?
>> > > > The emulator does not have a file browser...you will have to use
>> File
>> > > > Explorer in DDMS:http://code.google.com/android/reference/ddms.html
>> >
>> > > > 2008/8/27 immu <[EMAIL PROTECTED]>
>> >
>> > > > > Hi
>> > > > >  i have add some files(jpeg/mp3) in sdcard image, but  i am
>> > > > > unable to see them from Emulator
>> >
>> > > > > can any one  help me...plzz
>>
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: problem wid the sdcard

2008-08-29 Thread Payal Amin
I am trying to create a file browser for the sdcard.  And I have seen this
on htc touch phone.  In that phone if I click on sdcard it shows all the
files in that and if there is some file and I clicked on it, it will open
that file.  I am trying to create that kind of application.

My question was, if I can browse through sdcard and I know that the file is
"...txt" then why can't I open it like all other files?

Thanks

On Fri, Aug 29, 2008 at 10:04 AM, Mark Murphy <[EMAIL PROTECTED]>wrote:

>
> Payal Amin wrote:
> > I think we should be able to browse the sdcard files through
> > applications.. because in real phone when we insert an sdcard, we are
> > able to open all kind of files like a word file or text file.
>
> If by "real phone" you mean iPhone, I'm not aware that it has a Word
> viewer. Or an SD card slot, for that matter.
>
> If by "real phone" you mean Symbian, I believe there are third-party
> Word viewers, but I am not aware there is one that is part of the
> operating system.
>
> The only "real phone" that has a Word viewer built in by the mobile OS
> maker is Windows Mobile, AFAIK. Maybe Blackberry -- I am not sure if
> they wrote their own or if they licensed somebody else's reader.
>
> The point is, I am unclear why you think it is a given that the mobile
> OS creator has to provide Word viewers as part of the actual operating
> system, given that few of their competitors do.
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com
> Warescription: All titles, revisions, & ebook formats, just $35/year
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: problem wid the sdcard

2008-08-29 Thread Payal Amin
Hi Mark,
   thanks a lot for your reply.   now I am able to open and view the txt
file using some other file operations..  May be I will make different
activity to read the txt file from sdcard.

Thanks

On Fri, Aug 29, 2008 at 11:36 AM, Mark Murphy <[EMAIL PROTECTED]>wrote:

>
> > My question was, if I can browse through sdcard and I know that the file
> > is "...txt" then why can't I open it like all other files?
>
> To quote from the documentation:
>
> http://code.google.com/android/reference/android/content/Intent.html
>
> "For data that is not a content: URI and where no explicit type is
> included in the Intent, instead the scheme of the intent data (such as
> http: or mailto:) is considered. Again like the action, if we are matching
> a scheme it must be listed by the component as one it can handle. "
>
> You are assuming that Uri.parse("file://home/sdcard.img/test.txt") yields
> something that an Activity can understand and respond to. That does not
> appear to be the case given your symptoms, though I haven't tried it
> myself.
>
> You may wish to try using an explicit MIME type, to see if that helps (see
> Intent#setDataAndType()), but I suspect there simply is no "view a *.txt
> file" activity built into the operating system. That simply means you need
> to create a *.txt-file-viewer activity, no different than you might need
> to create a *.doc-file-viewer activity if you wanted to view Word files,
> or a *.csv-file-viewer activity if you want to view CSV files, etc.
>
> Please bear in mind that Android is not a file-centric OS to the extent
> that, say, Windows Mobile is. Neither is iPhone, near as I can tell.
> Paradigms like "file browsers" that may be trivial in one mobile OS may be
> somewhat more work in other mobile OSes, like Android or iPhone, just as
> things that may be relatively easy on Android (e.g., mapping application)
> might be excruciatingly painful on another mobile OS.
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com
> _The Busy Coder's Guide to Android Development_ Version 1.1 Published!
>
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Files reading

2008-09-10 Thread Payal Amin
you can try this

FileContains = new File(PathName);
File[] Filenames = FileContains.listFiles(
   new FilenameFilter() {

public boolean accept(File FileContains, String name) {

return name.endsWith(".mp3") || name.endsWith(".MP3");

}

});

Payal








Hi mark,

 thanks, but i am trying that java.io.file but its giving whatever
files in the SDcard whether it could be .txt etc. but i need only mp3
files list so if u have any idea than let ne know..

my code is loke this

   private File FileContains;

   FileContains = new File(PathName);
   if(FileContains.isDirectory()){
   Filenames = FileContains.listFiles();
   NoOfFiles = Array.getLength(Filenames);
   }

so from the above code it will give all the files list but i need only
mp3 files so if u have any idea then let me know

Thanks
Rakesh


>
>
> On Sep 10, 5:20 pm, Mark Murphy <[EMAIL PROTECTED]> wrote:
> > patelpower wrote:
> > > Hello everyone,
> >
> > >  i want to read the mp3 files only from the sdcard so is there any API
> > > so it could read only mp3 files and give the list of the files indise
> > > the SDcard
> >
> > Look in the java.io package. You probably want File#listFiles(), perhaps
> > one of the flavors that takes a filter parameter.
> >
> > --
> > Mark Murphy (a Commons Guy)http://commonsware.com
> > _The Busy Coder's Guide to Android Development_ Version 1.2 Published!
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] how to start the default music application from my own application

2008-11-12 Thread Payal Amin
Hi All,
I want to start the default Music application which is there when you
run the emulator from my own application say "hello world".  Can anybody
tell me how can i do so?

Thanks,
Payal

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: [android-developers] Re: how to start the default music application from my own application

2008-11-13 Thread Payal Amin
Hi Peli,
   One more question,  i want to play the songs from the sdcard, and the
song which will be played is whatever user selects from sdcard.  Can you
help me with this?

Thanks a lot,
Payal

On Thu, Nov 13, 2008 at 9:43 AM, Payal Amin <[EMAIL PROTECTED]> wrote:

> hi Peli,
>Thanks for your reply.  I tried your code and the default media player
> in sdk does appear on the emulator, but only for a second and then don't
> know it disappears.  Do i have to add anything else in the code?
>
> Thanks,
> Payal
>
>   On Thu, Nov 13, 2008 at 7:00 AM, Peli <[EMAIL PROTECTED]> wrote:
>
>>
>> http://www.openintents.org/en/node/112
>>
>> Peli
>> www.openintents.org
>>
>> On Nov 12, 7:56 pm, "Payal Amin" <[EMAIL PROTECTED]> wrote:
>> > Hi All,
>> > I want to start the default Music application which is there when
>> you
>> > run the emulator from my own application say "hello world".  Can anybody
>> > tell me how can i do so?
>> >
>> > Thanks,
>> > Payal
>>  >>
>>
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: [android-developers] Re: how to start the default music application from my own application

2008-11-13 Thread Payal Amin
never mind i solve the problems.

Thanks everybody for your help.

Payal

On Thu, Nov 13, 2008 at 10:05 AM, Payal Amin <[EMAIL PROTECTED]> wrote:

> Hi Peli,
>One more question,  i want to play the songs from the sdcard, and the
> song which will be played is whatever user selects from sdcard.  Can you
> help me with this?
>
> Thanks a lot,
> Payal
>
>   On Thu, Nov 13, 2008 at 9:43 AM, Payal Amin <[EMAIL PROTECTED]> wrote:
>
>> hi Peli,
>>Thanks for your reply.  I tried your code and the default media player
>> in sdk does appear on the emulator, but only for a second and then don't
>> know it disappears.  Do i have to add anything else in the code?
>>
>> Thanks,
>> Payal
>>
>>   On Thu, Nov 13, 2008 at 7:00 AM, Peli <[EMAIL PROTECTED]> wrote:
>>
>>>
>>> http://www.openintents.org/en/node/112
>>>
>>> Peli
>>> www.openintents.org
>>>
>>> On Nov 12, 7:56 pm, "Payal Amin" <[EMAIL PROTECTED]> wrote:
>>> > Hi All,
>>> > I want to start the default Music application which is there when
>>> you
>>> > run the emulator from my own application say "hello world".  Can
>>> anybody
>>> > tell me how can i do so?
>>> >
>>> > Thanks,
>>> > Payal
>>>  >>>
>>>
>>
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---