B4A Library [Lib] ScrollView2D

Discussion in 'Additional libraries, classes and official updates' started by Informatix, Jul 4, 2012.

  1. Informatix

    Informatix Expert Licensed User

    That could be a lot of things, but without a project to test, it's difficult to point you to the right direction.

    Regards,
    Fred
     
  2. johnaaronrose

    johnaaronrose Active Member Licensed User

    Problem solved

    Photo scrolling now working fine: I had some rogue coding which I've now removed. What is the best method to work out the Heap Size to be used in the emulator for a specific application? Re my previous question: Are there any implications using android16 in B4A in regard to running it on a 2.3.3 Emulator avd or an Android phone running 2.3.3 or earlier version?
    PS Should I start a new thread(s) for these questions?
     
  3. Informatix

    Informatix Expert Licensed User

    The emulator is great to test applications with the minimum heap size (16 Mb) so I'd recommend to always set this size for your tests. That ensures your app will work on every device.
    I cannot answer to the second question because I don't understand it.
     
  4. johnaaronrose

    johnaaronrose Active Member Licensed User

    I'll try and explain my second question: it was very difficult grammatically.

    Currently, I'm using android10 i.e. the Android SDK is for Android 2.3.3. Thus, I've 'Configured Paths' in B4A to use android.jar in the android10 folder. I test on emulator using 2.3.3 avd's with various resolutions (i.e. 320x480 & 480x800). Will my app's .apk run OK on devices with other Android versions: these could be older (e.g. 2.1) or newer (4.0)? If not, would using Android SDK 4.1 allow the .apk to run on all Android devices?
     
    Last edited: Sep 8, 2012
  5. Informatix

    Informatix Expert Licensed User

    The best way to know that is to test your app with different OS versions in the emulator.
     
  6. Chmava

    Chmava Member Licensed User

    is there a way to focus on scrollview2d so the DPad will scroll it?
     
  7. Informatix

    Informatix Expert Licensed User

    If you D-Pad works with a standard ScrollView, it should work with ScrollView2D. The contrary is also true.
     
  8. Chmava

    Chmava Member Licensed User

    thank you, turn out the solution was not related, lol. activity.requestfocus.
     
  9. Espinosa4

    Espinosa4 Active Member Licensed User

    After the application was minimized the program return an error

    Hello everybody!
    Firstly thank you very much indeed for this lib. It is great.

    I'd like to comment a problem that I have. When I minimize the application and the image is still on the screen, passed some minutes, when I return to the application show me this error

    Can you help me please?

    Capture link

    http://db.tt/hYpbdvaI
    [​IMG]
     
    Last edited: Jun 14, 2013
  10. Informatix

    Informatix Expert Licensed User

    I have no idea. Are you sure it is related to my library? It seems to me that it's because the system wiped out the memory of your application and your app is unable to recover from this situation.
     
  11. Espinosa4

    Espinosa4 Active Member Licensed User

    Thank you very very much for reply. I'll try to study the problem with the memory. I am very lost about this but step by step.

    Greetings
     
  12. johnaaronrose

    johnaaronrose Active Member Licensed User

    Monitoring Scroll Positions

    I have a map in a .jpg file: I set the ScrollView2D Background Image to its bitmap. This works OK. I'm able to scroll the map both horizontally & vertically. I need to be able to 'get' the Horizontal & Vertical Scroll Positions when the map is is scrolled. However, there seems to be no event associated with this ScrollView2D, which I need in order to store the new Scroll Positions. Am I missing something obvious?
     
  13. Informatix

    Informatix Expert Licensed User

    In the IDE, enter Sub + Space + Tab and the event list will appear. SV2D has an event called ScrollChanged.
     
  14. klaus

    klaus Expert Licensed User

    The event is : ScrollView2D.ScrollChanged(PosX As Int, PosY As Int)

    Best regards.
     
  15. johnaaronrose

    johnaaronrose Active Member Licensed User

    ScrollChanged event

    Unfortunately, (in the IDE) entering Sub + Space + Tab only makes the event list appear for a split second before disappearing. I've tried:
    "Sub sv2dMap.ScrollChanged",
    "Sub sv2dMap_ScrollChanged",
    "Sub sv2dMap.ScrollChanged(PosX as int, PosY as Int)",
    "Sub sv2dMap_ScrollChanged(PosX As Int, PosY As Int)".
    The latter 2 give compile errors: sort of expected this because it seems to me that the HorizontalScrollPosition should be equivalent to PosX & the VerticalScrolllPosition property should be equivalent to PosY. The former 2 do not cause the Sub to be entered when scrolling is done at runtime: I know this because I've put a MsgBox command in the Sub.

    PS I've looked at the documentation for Scrollview2D & there's no mention of the ScrollChange event in it that I see.
     
  16. klaus

    klaus Expert Licensed User

    What version of ScrollView2D are you using ?
    The last version is 1.10.

    Look at the attached test project, it works !
    So I really don't know what you have tried to do.

    Best regards.
     

    Attached Files:

  17. Informatix

    Informatix Expert Licensed User

    You have a problem with your IDE then, because this list is not supposed to disappear.

    This one is correct.
    This event is used in the example that you'll find with the library (since the first version).

    You can rename the parameters in the event declaration if you prefer to call PosX "HorizontalPosition".
     
  18. johnaaronrose

    johnaaronrose Active Member Licensed User

    Sv2DExample ignores sv2d_scrollchanged sub

    I run B4A under Wine using Ubuntu on my desktop, as I do not use Windows. This has a problem with compiling to my Android phone (probably due to Wine) whether I use USB cable, wireless or Bluetooth i.e. it does not find the device when compiling. So I compile & then copy the .apk (from my desktop) to the phone's sdcard by connection with a USB cable & allowing file copying using usb under GingerBread. I then install the app from the sdcard. I can see the Log using the Android CatLog app (downloaded from Google Play Store & works well). After installing & running Sv2DExample_Debug, CatLog shows "B4A W ignoring event sv2d_scrollchanged" and there is no display of PosX & PosY.
    PS I'm now running ScrollView2D v 1.10 (previously running 1.03) & have reloaded it in my app without making a difference.
     
    Last edited: Jun 25, 2013
  19. Informatix

    Informatix Expert Licensed User

    The message "ignoring event" is only sent to the log (by B4A) when the activity is paused (the event is ignored for this good reason).

    Did you run my example code unmodified? If yes, then the only culprit that I see here is Wine or CatLog, because ScrollView2D raises its events with the same function as all other B4A views with events. There's nothing particular about it.

    Try also the Klaus's example. The output is redirected to the activity title.
     
  20. johnaaronrose

    johnaaronrose Active Member Licensed User

    I copied the .apk file generated by compiling the project containing your unmodified Sv2DExample.b4a. Interestingly, I amended Klaus's SQLiteDB by adding
    Msgbox("Posx="&PosX&",PosY="&PosY, "scvList_ScrollChanged")
    immediately after Sub scvList_ScrollChanged(PosX, PosY)
    and it displayed the Msgbox at runtime. I've just amended it by adding the same line after the Sub line to Sv2DExample and that now displays the Msgbox.

    So it looks like CatLog is misbehaving. I think that the problems might be due to having only 353MB space on the sdcard & *perhaps more importantly) 44MB space on internal storage. Is that reasonable?
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice