Android Tutorial ImageDownloader - The simple way to download images

Status
Not open for further replies.

Beja

Expert
Licensed User
Hi,
I used the above method:
B4X:
Public Sub ClearCache
   cache.Clear
End Sub
But I get the message on compile saying
Cache is used before assigning any value..
Any meaning appreciated.
 

Beja

Expert
Licensed User
No mention for process global variable, becides didn't know what to declare. Thanks for your help.
 

Beja

Expert
Licensed User
Hi Erel,
Thanks and yes, I appended it at the end of the module, this is what I got:
LogCat connected to: emulator-5554
** Activity (main) Create, isFirst = true **


customlistview_clear (java line: 93)


java.lang.NullPointerException

at b4a.maps.example.customlistview._clear(customlistview.java:93)
at b4a.maps.example.main._activity_create(main.java:336)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:187)
at b4a.maps.example.main.afterFirstLayout(main.java:100)
at b4a.maps.example.main.access$100(main.java:17)
at b4a.maps.example.main$WaitForLayout.run(main.java:78)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)
java.lang.NullPointerException
** Service (httputils2service) Create **


** Service (httputils2service) Start **


** Activity (main) Resume **


java.net.UnknownHostException: www.loc.gov
 

Erel

Administrator
Staff member
Licensed User
Run your code in debug mode to see the line that raises the error.
 

Beja

Expert
Licensed User
debugwindow.jpg
it is from clv.clear.. is it because it was put before the initialization line?
 

Erel

Administrator
Staff member
Licensed User
You are calling a method on clv before it was initialized.
 

johnB

Active Member
Licensed User
Hi
(Sorry if I have posted this in the wrong place but there are many examples/tutorials on retrieving images on the forum)
I'm trying to download images from my Windows Server to display.
I'm having trouble with the Address(Link).
I have been successfully using the address with RDC for, well as long as RDC's been available
Wondering if somebody would be good enough to point out where i'm going wrong

In RDC, the address I'm using is - reqManager.Initialize(Me, "http://j??????????.?????.net:17178"), this is a No-IP address

In the image download programs available on the forum

In the Flicker example I have used something like this - MainUrl = "http://www.j?????????.????.net/C:/Users/jb/Pictures/Family/" where the images are in C:/Users/jb/Pictures/Family/. I've tried it with the Server Name - \\WIN-KA57JNPJAAS but that didn't work either. I've tried many different combinations without success.

In the ImageDownloader2 example , again I have tried numerous variation without success eg

pageJob.Download("http://j?????????.????.net:17178/?method=test#WIN-KA57JNPJAAS/Users/jb/Dropbox/Photos/jb")
pageJob.Download2("http://j????????.????.net:17178/?method=test#WIN-KA57JNPJAAS/Users/jb/Dropbox/Photos/jb", Array As String("User = A......", "Password = A......"))
'pageJob.Download2("http://j?????????.????.net:17178/?method=test", Array As String("WIN-KA57JNPJAAS/Users/jb/Dropbox/Photos/jb"))

I'm sure it must need a Use and Password somewhere

Thanks in anticipation
 

DonManfred

Expert
Licensed User
In the ImageDownloader2 example , again I have tried numerous variation without success eg
You are confusing two different things. RDC has nothing to do wqith imagedownloading.

The image must be accessible via a webserver running on that machine and you need to use the right url for the download. Not the RDC url
 

johnB

Active Member
Licensed User
Ok thanks, so I need something like Apache and PHP on the Server, I've used them a long time ago
 

johnB

Active Member
Licensed User
Thanks Don for your prompt reply, I'll download them and see what my memory is like, but there's plenty of Online support these days, not like the days when I had to go into a city book store and spend $70 on a book. I have 2 on PHP, Apache and MySql, old but a good starting point

Thanks again
 
Status
Not open for further replies.
Top