S Sanxion Active Member Licensed User Longtime User Apr 21, 2016 #1 Hi all Does anybody have any code that loads a series of images into an image viewer and then displays them one at a time at a predefined interval - upon clicking on am image, a URL is loaded. I suppose I want something similar to how Admob works. Thanks
Hi all Does anybody have any code that loads a series of images into an image viewer and then displays them one at a time at a predefined interval - upon clicking on am image, a URL is loaded. I suppose I want something similar to how Admob works. Thanks
somed3v3loper Well-Known Member Licensed User Longtime User Apr 21, 2016 #2 You might want to check ImageDownloader https://www.b4x.com/android/forum/threads/imagedownloader-the-simple-way-to-download-images.30875/ Upvote 0
You might want to check ImageDownloader https://www.b4x.com/android/forum/threads/imagedownloader-the-simple-way-to-download-images.30875/
S Sanxion Active Member Licensed User Longtime User Apr 21, 2016 #3 somed3v3loper said: You might want to check ImageDownloader https://www.b4x.com/android/forum/threads/imagedownloader-the-simple-way-to-download-images.30875/ Click to expand... Thanks for the response but my images are already in the app and don't require downloading. Also, all the images are to be displayed in the same image view and not separate ones. Upvote 0
somed3v3loper said: You might want to check ImageDownloader https://www.b4x.com/android/forum/threads/imagedownloader-the-simple-way-to-download-images.30875/ Click to expand... Thanks for the response but my images are already in the app and don't require downloading. Also, all the images are to be displayed in the same image view and not separate ones.
somed3v3loper Well-Known Member Licensed User Longtime User Apr 21, 2016 #4 Sanxion said: Thanks for the response but my images are already in the app and don't require downloading. Also, all the images are to be displayed in the same image view and not separate ones. Click to expand... You need a timer and maybe a FileName variable you that changes in timer_Tick event and B4X: yourImageView.Bitmap=LoadBitmap(File.DirAssets,FileName) Upvote 0
Sanxion said: Thanks for the response but my images are already in the app and don't require downloading. Also, all the images are to be displayed in the same image view and not separate ones. Click to expand... You need a timer and maybe a FileName variable you that changes in timer_Tick event and B4X: yourImageView.Bitmap=LoadBitmap(File.DirAssets,FileName)
S Sanxion Active Member Licensed User Longtime User Apr 21, 2016 #5 somed3v3loper said: You need a timer and maybe a FileName variable you that changes in timer_Tick event and B4X: yourImageView.Bitmap=LoadBitmap(File.DirAssets,FileName) Click to expand... Could you give some sample code of how to loop through a list of images in the timer so it select the next one in the list? Thanks. Upvote 0
somed3v3loper said: You need a timer and maybe a FileName variable you that changes in timer_Tick event and B4X: yourImageView.Bitmap=LoadBitmap(File.DirAssets,FileName) Click to expand... Could you give some sample code of how to loop through a list of images in the timer so it select the next one in the list? Thanks.
somed3v3loper Well-Known Member Licensed User Longtime User Apr 21, 2016 #6 B4X: Dim images as list in Process_Globals B4X: images.Initialize images.addall(array as string("file1","file2")) probably in Activity_Create and in timer_Tick event you might do this B4X: dim index as int =rnd(0,images.size-1) yourImageView.Bitmap=LoadBitmap(File.DirAssets,images.get(index) I am not sure whether it is the best way . someone might improve it Upvote 0
B4X: Dim images as list in Process_Globals B4X: images.Initialize images.addall(array as string("file1","file2")) probably in Activity_Create and in timer_Tick event you might do this B4X: dim index as int =rnd(0,images.size-1) yourImageView.Bitmap=LoadBitmap(File.DirAssets,images.get(index) I am not sure whether it is the best way . someone might improve it
somed3v3loper Well-Known Member Licensed User Longtime User Apr 21, 2016 #7 That is if you want images to be chosen randomly If not index should be a global variable and you increase its value each time you set a new image B4X: yourImageView.Bitmap=LoadBitmap(File.DirAssets,images.get(index) if index>images.size-1 then index=0 else index = index+1 end if Upvote 0
That is if you want images to be chosen randomly If not index should be a global variable and you increase its value each time you set a new image B4X: yourImageView.Bitmap=LoadBitmap(File.DirAssets,images.get(index) if index>images.size-1 then index=0 else index = index+1 end if
S Sanxion Active Member Licensed User Longtime User Apr 21, 2016 #8 somed3v3loper said: That is if you want images to be chosen randomly If not index should be a global variable and you increase its value each time you set a new image B4X: yourImageView.Bitmap=LoadBitmap(File.DirAssets,images.get(index) if index>images.size-1 then index=0 else index = index+1 end if Click to expand... Thank-you Upvote 0
somed3v3loper said: That is if you want images to be chosen randomly If not index should be a global variable and you increase its value each time you set a new image B4X: yourImageView.Bitmap=LoadBitmap(File.DirAssets,images.get(index) if index>images.size-1 then index=0 else index = index+1 end if Click to expand... Thank-you