Android Tutorial [B4X] Cross platform Editable B4XTable + Form Example

Discussion in 'Tutorials & Examples' started by Erel, Apr 11, 2019.

Thread Status:
Not open for further replies.
  1. Erel

    Erel Administrator Staff Member Licensed User

    [​IMG]

    This example demonstrates several things:
    • Cross platform code and files, similar to the way XUI2D games are organized:
      • All the logic is implemented in a class named EditableTable. The module is located in the projects parent folder.
      • The two asset files (list of animals - source; and the preferences dialog template) are stored in the Shared Files folder and are copied when needed with a #CustomBuildAction command. You can see it in the EditableTable class. Note that if you want to update those files then you need to update the files in the Shared Files folder. The project specific files will be updated automatically.
    • Using B4XTable and B4XPreferencesDialog to create an editable table. Table features:
      • Add new items.
      • Edit existing items.
      • Delete existing items.
      • Duplicate existing items.
      • Data is saved when the app closes to a CSV file.
      • Saved data is loaded when the app starts.
    Dependencies:

    - B4XPreferencesDialog v1.30+: https://www.b4x.com/android/forum/threads/103842/#content
    - B4XTable v1.10+: https://www.b4x.com/android/forum/t...ortable-searchable-customizable-table.102322/
    - XUI Views v2.00+: https://www.b4x.com/android/forum/threads/b4x-xui-views-cross-platform-views-and-dialogs.100836/

    The B4A, B4i and B4J projects are attached.
     

    Attached Files:

    Last edited: Apr 11, 2019
  2. makis_best

    makis_best Member Licensed User

    Nice work..
    Can data be saved in SQL database?
     
  3. jimmyF

    jimmyF Active Member Licensed User

    Save it anywhere you want, I believe.

    Add SQLite to your app, create the database, and save and read the data.
    or
    Add jRDC2 to read and save the data on a server.

    Both SQLite and jRDC2 are searchable items on the forum.

    Let us know how it works out.

    -j
     
    Erel likes this.
  4. Erel

    Erel Administrator Staff Member Licensed User

    That's true. It is simple to save the data with any data store you like. This includes: CSV, SQL db, JSON, KVS2 and any other store you can think of.
     
    jimmyF likes this.
  5. GMan

    GMan Well-Known Member Licensed User

    I got ths message when compiling:

    Code:
    ....
    Fehlerbeschreibung: Unbekanntes Mitglied: daysinweekcolor
    Fehler 
    in Zeile: 309
    DateTemplate.DaysInWeekColor = xui.Color_Gray
    Word: daysinweekcolor
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    See the list of dependencies in the first post.
     
  7. José J. Aguilar

    José J. Aguilar Active Member Licensed User

    Check you have the right version of XUI Views (v2.00)
     
  8. GMan

    GMan Well-Known Member Licensed User

    Jo, stupid me ... was 1.9

    How can i create another query window ?
     
  9. Erel

    Erel Administrator Staff Member Licensed User

    Please start a new thread for any question you have.
     
Thread Status:
Not open for further replies.
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