Mark M. | has entered the room |
Mark M. | turned on guest access |
Oct 31 | 7:25 PM |
Maurizio | has entered the room |
Maurizio |
Hi Mark
|
Mark M. |
hello, Maurizio
|
Mark M. |
how can I help you today?
|
Maurizio |
First of all thank you
|
Mark M. |
you are welcome, though I am not quite certain for what :-)
|
Maurizio |
I will try to explain and see if you could give me some guidance
|
Maurizio |
for your excellent job Mark!
|
Maurizio |
anyway...
|
Maurizio |
I would like to build some kind of "downolader"
|
Maurizio |
View paste
|
Maurizio |
what do you think, which wy shoud >I go?
|
Mark M. |
um, for what, specifically?
|
Maurizio |
if i open the brwser
|
Oct 31 | 7:30 PM |
Maurizio |
and there is an attachmet to be downloaded
|
Maurizio |
i would like the app to open up
|
Maurizio |
and save the file in its private storage
|
Bob R. | has entered the room |
Maurizio |
I do not know if it is clear enogh?
|
Mark M. |
I understood all of thqat
|
Mark M. |
er, that
|
Bob R. |
Hi all:)
|
Mark M. |
however, what I do not understand is "which wy shoud >I go"
|
Mark M. |
(hello, Bob, I will be with you shortly!)
|
Bob R. |
Hi Mark
|
Mark M. |
Maurizio: everything you list is covered in the book
|
Mark M. |
Internet chapter covers downloads
|
Maurizio |
because honestly I do not know wheere to start from
|
Mark M. |
Fils chapter covers internal storage
|
Mark M. |
er, Files chapter
|
Bob R. |
I dived into your book this week and am enjoying it very much.
|
Mark M. |
well, I cannot really answer that, other than to start with "Hello, world" :-)
|
Mark M. |
(hello, Bob, *I will be with you shortly!*)
|
Maurizio |
can i force download from the browers to a specific directory on my app?
|
Bob R. |
Sure
|
Mark M. |
Maurizio: not really, as the browser authors are welcome to do what they want
|
Maurizio |
so basically I can't...
|
Mark M. |
is there something specific about the files that you are seeking to download, like a specific MIME type?
|
Maurizio |
no, that is the point, I would like to be able to redicrect all download to the app...
|
Mark M. |
then you will need to write your own Web browser
|
Maurizio |
hehehe
|
Mark M. |
and convince people to use it rather than Chrome, Firefox, etc.
|
Oct 31 | 7:35 PM |
Maurizio |
I suppose it's the same for the mail client...
|
Mark M. |
more or less
|
Mark M. |
let me take a question from Bob, and we can continue discussing this in a bit
|
Maurizio |
Ok
|
Mark M. |
Bob: do you have a question?
|
Bob R. |
I have a question relating to running lint. When I entered stuff directly out of a book (not yours yet, I had a lot of warning msgs. Then When I ran clean or lint they went away. Many times @Override was added where it wasn't. I deleted them back out because the book I was reading didn't have them. Is there a rule of thumb as to when you use @Override?
|
Mark M. |
you @Override when you are overriding a method of a superclass, or implementing a method defined on an interface
|
Mark M. |
the latter requires you to be using Java 6, and if you are using Eclipse, it requires Eclipse to be using Java 6 rules for examining your source code for warnings/errors
|
Bob R. |
OK I on page 200 of your book. I;m not sure what this means.
|
Mark M. |
(see page 19, 2nd paragraph, for more details about the Eclipse bit)
|
Bob R. |
OK Thanks,
|
Mark M. |
page 200 of the book is blank
|
Mark M. |
note that I released Version 5.2 a couple of weeks ago
|
Bob R. |
OK I'll check. I'm just beginning to read the WebView
|
Mark M. |
let me take another question from Maurizio, and I will be back with you in a bit
|
Mark M. |
Maurizio: do you have another question?
|
Bob R. |
Sure
|
Oct 31 | 7:40 PM |
Bob R. |
Thanks for your help
|
Maurizio |
not really
|
Maurizio |
I understand that what I would like to do is not achievabe
|
Maurizio |
correct?
|
Mark M. |
well, you are welcome to create an app that has an <intent-filter> saying that you handle all HTTP requests, like a browser
|
Mark M. |
users will uninstall your app within minutes
|
Mark M. |
because every time they click a link, they'll be forced to choose between your app and their regular browser
|
Mark M. |
or, they'll just make their regular browser the default, then eventually uninstall your app when they can't quite figure out why they have it
|
Mark M. |
what would your app be doing, for the user, that is different from what the browser already does?
|
Mark M. |
in other words, what is "the value-add" of your app?
|
Maurizio |
is meant to be used by unskilled users
|
Mark M. |
that is not a very useful answer
|
Mark M. |
"Hello, world" is meant to be used by unskilled users too
|
Maurizio |
so that they can put their dowloads (=documents) of choice stored in a single application
|
Mark M. |
they already have this
|
Mark M. |
it's called the Downloads app
|
Mark M. |
it is on 95% of Android devices
|
Maurizio |
I know... :-)
|
Mark M. |
um, OK
|
Mark M. |
let me swing back to Bob for a bit
|
Mark M. |
Bob: do you have another question?
|
Oct 31 | 7:45 PM |
Maurizio |
well, ok Mark, thank you for your advice
|
Oct 31 | 7:45 PM |
Maurizio |
have a very nice evening
|
Mark M. |
you too!
|
Maurizio |
and keep on writing excellent books!
|
Maurizio |
Night!
|
Maurizio | has left the room |
Mark M. |
Bob: do you have another question?
|
Oct 31 | 7:50 PM |
Bob R. |
Yes I do
|
Oct 31 | 7:55 PM |
Bob R. |
My eclypse is currently set to 1.7 should I change it to 1.6?
|
Mark M. |
do you mean in Preferences > Java > Compiler?
|
Bob R. |
yes
|
Mark M. |
then that should be fine, so long as you actually have Java 1.7
|
Mark M. |
1.5 is the value that causes problems
|
Mark M. |
anything higher than 1.5 should be fine
|
Bob R. |
OK Thanks
|
Bob R. |
Also I have a question out on Stack Overflow.
|
Mark M. |
do you have a link?
|
Bob R. |
Yes.
|
Bob R. | |
Bob R. |
They close the questions if it appears vague
|
Mark M. |
and, to be honest, you are lucky that this one was merely ignored instead of closed
|
Oct 31 | 8:00 PM |
Mark M. |
saying "I tried several things and I wasn't able to get it to work" is not particularly helpful
|
Mark M. |
you need to explain *what* you tried and *what* did not work
|
Mark M. |
the rest of your question is littered with confusing phrases
|
Mark M. |
JSON files do not have photos, as they are text files
|
Mark M. |
it is unclear what an "email process" is
|
Bob R. |
Yea I'll go back a rework the question after I read more in your book. Your book is answering a lot of questions for me.
|
Mark M. |
in general, text messages (SMS) are text, like JSON files, and therefore do not have images
|
Bob R. |
My process automatically builds a text message via anything available on the phone
|
Bob R. |
Text msg, email etc.
|
Bob R. |
I was trying to attach a photo to it
|
Mark M. |
um, OK
|
Mark M. |
what does "automatically builds a text message" mean?
|
Bob R. |
I was trying to attach a photo to an email or txt. I thought that it wass possible.
|
Oct 31 | 8:05 PM |
Mark M. |
well, that depends a bit on what you mean by "attach a photo to an email or txt"
|
Bob R. |
The user has a specific criteria and I put together several strings
|
Mark M. |
um, OK
|
Mark M. |
let's focus first on email
|
Mark M. |
you say that you are trying to send an email
|
Mark M. |
how are you doing that?
|
Mark M. |
ACTION_SEND?
|
Mark M. |
ACTION_SENDTO?
|
Bob R. |
the email or txt msg is triggered and the user can send it from whatever txt msg or email system is on their phone
|
Mark M. |
JavaMail library?
|
Mark M. |
something else?
|
Bob R. |
The image is saved to a json file
|
Mark M. |
no, it is not
|
Mark M. |
JSON is a text format, not a binary format
|
Mark M. |
you do not save an image to a JSON file
|
Mark M. |
(well, OK, you could base-64-encode the byte array or something, but that's just bizarre)
|
Mark M. |
so, I will ask again: how are you trying to send the email?
|
Bob R. |
I have to review what I did. I can save a photo with text into a listview with date and time
|
Mark M. |
no, you can *display* a photo with text in a ListView with date and time
|
Mark M. |
a ListView is a user interface widget
|
Mark M. |
it is not a data storage mechanism
|
Mark M. |
you do not "save" anything into a ListView
|
Bob R. |
The text is saved to json. Shows you how much I know.
|
Oct 31 | 8:10 PM |
Mark M. |
putting text into JSON is certainly possible
|
Bob R. |
I know that the project saves all the data onto a JSON file, and I thought the image from the photo was also saved there.
|
Mark M. |
it certainly seems unlikely
|
Bob R. |
Now I;m really confuded
|
Bob R. |
I'll send u a piece of code
|
Mark M. |
um, well, you are welcome to upload a file into the chat room, if you want
|
Bob R. |
View paste
(7 more lines)
|
Oct 31 | 8:15 PM |
Bob R. |
This code is taken from the book The Big Nerd Ranch
|
Oct 31 | 8:15 PM |
Bob R. |
Where's the Photo going?
|
Mark M. |
the image is already in a file somewhere
|
Mark M. |
I think that the JSON is just holding a path to the image
|
Bob R. |
So the image is actually in a separate file?
|
Mark M. | |
Mark M. |
the comment on the Photo constructor is "Create a Photo representing an existing file on disk"
|
Mark M. |
and toJSON() stores the filename in the JSON
|
Bob R. |
OK. I think I'll just continuing with your book for a while. I'm realizing just how much I dont know.
|
Oct 31 | 8:20 PM |
Bob R. |
So If you are saving everything internally, the photo goes into one file and the rest of the data goes into another?
|
Mark M. |
well, it's more that JSON is a text file, and so it cannot readily hold binary data like an image
|
Mark M. |
similarly, HTML is a text file, and so it cannot readily hold binary data like an image
|
Bob R. |
So in therms of an internal file, its saved differently?
|
Mark M. |
that is why, when you put images on a Web page, you reference other files
|
Bob R. |
so much I've yet to learn.
|
Mark M. |
I have no idea how to parse your last question, sorry
|
Bob R. |
Sorry. I'm just confused
|
Bob R. |
thanks for your time
|
Mark M. |
you are very welcome
|
Oct 31 | 8:25 PM |
Bob R. |
I meant earlier : when saving internally, you save the photo image in an image file and the rest of the data into a JSON file. Correct?
|
Mark M. |
correct
|
Bob R. |
Again thanks, I think I'll stick with only your book for a while.
|
Bob R. |
Holding off with implementing anything just yet.
|
Bob R. |
Have a great evening.
|
Mark M. |
you too!
|
Bob R. |
All this new stuff. I think I've been getting a little overwealmed.
|
Mark M. |
it does get a bit complicated
|
Bob R. |
I had no idea:)
|
Oct 31 | 8:30 PM |
Mark M. |
and that's a wrap for today's chat
|
Mark M. |
the transcript will be posted shortly to http://commonsware.com/office-hours/
|
Mark M. |
the next chat is tomorrow, 4pm Eastern
|
Bob R. |
Thanks Mark
|
Bob R. | has left the room |
Mark M. | turned off guest access |