B4A Class ImageInternetChooser: pick image icon up from Internet directly

End-users of some apps may need to choose small icons to save it into app's database.
But there was no tool to choose a needed icon in 2-3 taps, but the Internet is always under finger.
It seems, now it's possible.

No fully free services with API for image searching, with good big database, so... i invented the max universal way

I have made the class that helps
  • to search pictures by a needed URL
  • choose the needed icon
  • get it into your app.
Dependencies:
  • OkHTTPUtils2
  • StringUtils
  • WebViewExtras, WebViewExtras2, WebViewSettings
Video: Class is in the project .ZIP file.
Comments, fixes and updates are welcome.

 

Attachments

  • 1.png
    332.9 KB · Views: 388
  • 2.png
    325.6 KB · Views: 368
  • 3.png
    329.4 KB · Views: 353
  • 4.png
    504.2 KB · Views: 358
  • iic_project_v.0.1.zip
    14.4 KB · Views: 413
Last edited:

peacemaker

Expert
Licensed User
Longtime User
If it might be interesting - the separate "Internet Image Picker" provider app is also developed, in the 1st post.
App works as:
  • image grabber from Internet
  • gallery of the grabbed images
  • image sharing provider for other apps
 

andyr00d

Member
Licensed User
Longtime User
I've implemented a similar solution using the free Pixabay API:

B4X:
Dim API_KEY As String = "XXXXX"
        Dim res As String
        Dim GetImageJob As HttpJob
        GetImageJob.Initialize("GetAddress", Me)
        GetImageJob.Download("https://pixabay.com/api/?key=" & API_KEY & "&q=" & imgString & "&image_type=illustration&safesearch=true&pretty=true")
        Wait For (GetImageJob) JobDone(GetImageJob As HttpJob)
        If GetImageJob.Success Then
            Dim jp As JSONParser
            jp.Initialize(GetImageJob.GetString)
            Dim m As Map = jp.NextObject
            Dim results As List = m.Get("hits")
            If results.Size > 0 Then
                Dim first As Map = results.Get(0)
                res = first.Get("webformatURL")
                Log(res)
                'update ivMain with image
                SetImage(res, imgString)
            End If
        End If
        GetImageJob.Release

You can get more information on the API parameters here
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…