Office Hours — Today, March 7

Yesterday, March 6

Mar 7
3:55 PM
Mark M.
has entered the room
Mark M.
turned on guest access
midas
has entered the room
midas
hey mark
Mark M.
hello, midas!
how can I help you today>
er, today?
midas
well I have an interesting new requirement in my companies app
wanted to get your advice
the company wants both android and ios teams
to download a js script
4:00 PM
midas
which contains logic that needs to be executed
relatively frquently
I have been having a hard time just downloading the file itseld
*itself
I get the byte[]
and try to convert it into a string
and get gibberish
I think that once I get the stringified js Ill be ok
Mark M.
well, if you're using OkHttp, you can get the response body as a string
midas
so the question is how to convert the byte [] into a .js file
Ed T.
has entered the room
Mark M.
how are you downloading it?
midas
I am currently not using okhttp
Mark M.
(BTW, hello Ed -- I will be with you shortly!)
midas
networking lib is volley
(it was there when I got the project)
internally it uses HURLConnection (I think)
Mark M.
then use StringRequest
midas
same issue
gibberish
I think that the issue is that its converting the file headers also
Mark M.
"file headers"?
midas
for example
I see the file name in the gibberish
which is not in the content
Mark M.
my guess is that there is some issue with the server and how it is serving the response
midas
well the ios guy got it to work
so I dont think thats it
also I can load the js in a browser
Mark M.
that may just mean that iOS is friendlier to broken servers than is HURLConnection
midas
its hosted on s3
4:05 PM
Mark M.
I don't know what to tell you
lots of people use StringRequest
midas
for .js files?
Mark M.
that should not matter
midas
I didnt think so either
Mark M.
unless S3 is doing something strange when publishing such files
midas
well thanks anyway
Mark M.
you might set up a scrap project and try other clients (e.g., OkHttp) and see if you have better luck
midas
I will now resume banging my head into my keyboard
Mark M.
I don't recommend that -- it's hard on the keyboard
:-)
Ed T.
lol
midas
yeah I have been pushing to move to Retrofit for a while now
Mark M.
let me take a question from Ed, and I'll be back with you shortly
Ed: your turn! do you have a question?
Ed T.
ty
midas
thanks anyway Mark
Ed T.
yes sir
it should be 'easy' and I did Java Swing for 10 years
but wow
can you advise me on the best approach for formatting text in a TextView dynamically ?
this was much easier in iOS and Java Swing
Mark M.
what exactly do you mean by formatting? bold, italic, etc.?
Ed T.
no, I consider that a Font attribute
so I want an edit mask like... (xxx) xxx-xxxx
or you type in a number and as you type... I adjust it dynamically for xxx,xxx,xxx
Mark M.
Ed T.
NICE!
4:10 PM
Mark M.
with luck, the particular masks that you want are supported by 1+ of the libraries
Ed T.
you're the best $20 I spend... just saying
:)
thanks!
Mark M.
thanks for the kind words! though I think that you're forgetting that one really awesome pizza that you ordered...
anyway, even if what you want isn't directly supported, you can use those as inspiration
most probably use TextWatcher
Ed T.
Thanks again Mark. Cheers
Mark M.
let me take a question from midas, and I'll swing back to you in a bit
midas: your turn! do you have another question?
Ed T.
I'm good, cheers
Ed T.
has left the room
4:20 PM
midas
has left the room
5:00 PM
Mark M.
turned off guest access

Yesterday, March 6

 

Office Hours

People in this transcript

  • Ed Tidwell
  • Mark Murphy
  • midas