Android Question How to OPEN .xls file from dropbox .. not download

TMa

Member
Licensed User
Longtime User
Hi

I want straight to open .xls file from dropbox ..
Ihave tryed this:
---------------------------
Dim p As PhoneIntents
StartActivity(p.OpenBrowser("https://www.dropbox.com/something.xls"))
-----------------------
But it only force me to download file.. How I can I straight open it with my default .xls viewer :eek: ?
 

TMa

Member
Licensed User
Longtime User
ok .. so I click my button ... and from dropbox there comes text "download" .. then I have to accept it. And I open it from its download location with some code.
BUT ... is there then a way to download without accepting it .. so download and open is then automatic.

In my dropbox is file and it updates sometimes.. and I want allways open newest version from there without any extra download buttons.

I hope you understand what I mean :)

Or is that problem from dropbox.. so I just have to allways accept that download
 
Upvote 0

TMa

Member
Licensed User
Longtime User
Upvote 0

TMa

Member
Licensed User
Longtime User
I get error (invalid number of parentheses)
"j.Download(<https://www.example.com/xxx.xls>)"

Do I just put that Erels code to "button1_Click"

I am newbie with this programming, so forgive me that :)
This is a little bit different than normal basic with commodore 64 :)
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
i think it must be

B4X:
j.Download("https://www.example.com/xxx.xls")
 
Upvote 0

TMa

Member
Licensed User
Longtime User
yes.. it works better :) but...
after that it says syntax error in "Sub JobDone(j As HttpJob)"
If I do it like Sub JobDone("j" As HttpJob)
it converts rest of lines with "J" letter to "("
like this
If (.Success Then
and
(.Release

So it still dont even compile..

I have libraries httputils2 and http v1.31 .. same thing both of those.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
the code

B4X:
Dim j As HttpJob
j.Initialize("j", Me)
j.Download(<your link>)

must be in a sub... sub activity_create for example...

B4X:
Sub JobDone(j As HttpJob)
If j.Success Then
  Dim out As OutputStream = File.OpenOutput(File.DirRootExternal, "1.xls")
  File.Copy2(Job.GetInputStream, out)
  out.Close
End If
j.Release
End Sub

must be outside an sub.
 
Upvote 0
Top