1. B

    Android Question How can I work with maps values?

    Hello everyone, firstly I have to tell you that I'm a beginner so please, be patient. Here is my problem, in my code, I have a map and I need to a sum with these values. Here is my code ListaArticulos.Initialize NewArt.Initialize NewArt.Put("nombre","Harina COLOLO 0000 1kg.")...
  2. Hadi57

    Android Question how to get a List from Map after write and read the map.

    Probably a beginner problem. but i can't get a list in map after Write it and Read again. i get this error message: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.List Dim mapSetting As Map mapSetting.Initialize Dim List1 As List...
  3. OliverA

    Android Code Snippet [B4X] UrlEncodeMap

    ' UrlEncodeMap(input As Map) As String ' Converts a Map's keys/values to a URL encoded parameter string ' Following library is used ' B4J - jStringUtils ' B4A - StringUtils ' B4i - iStringUtils Sub UrlEncodeMap(input As Map) As String Dim sb As StringBuilder Dim su As StringUtils...
  4. M

    iOS Question Copy a Map to another oen

    Hi in B4i how can I copy a map into another? Given the fact the function "GetKeyAt" and "GetValueAt" doens't exists? Thanks!
  5. LucaMs

    Android Question Strange problem with a Map

    Test project attached (its design also is strange, but it is similar to my real project). Error occurred on line: 37 (Main) Line 37 is an empty line. java.util.NoSuchElementException at java.util.LinkedHashMap$LinkedHashIterator.nextNode(
  6. KMatle

    B4J Tutorial [B4x] Exchange Data via OkHttpUtils and php (or other platforms) via lists, maps, arrays, etc.

    I made 7 examples how to exchange data between B4x apps and php. I use the POSTSTRING method as it is simple, secure (get-methods will be logged with the data autmatically on the server, post-methods not), strings can be formatted very easy (JSON) and en-/decrypted (not included but see my other...
  7. OliverA

    B4J Question For Each/Next List of Maps and references. What am I misunderstanding?

    B4J Version: 7.51 OS Platfrom: Win10 Pro (1903) JDK: 11.0.1 downloaded from B4X's site Here's the setup. I'm creating a list of maps that contain x, y values (note: in my case, the map contains way more info, I'm just simplifying it here to show the issue I'm running into) Dim largestX As...
  8. M

    Android Question Is there a way to create/return an explicit cast of a List/Map.

    Ex: Dim myLife as Map (As yearstring, As Wine) If myLife.Get("2019").IsTonsOfWine = True Then... Because I haven't found any with the IDE or in the forums. That would be a huuuuuuuuuuuuuuuuuuuuuuuge time saver I believe. Thanks !
  9. DroidLyon

    Android Question B4XOrderedMap / Map - putting a type object problem

    Hi people I've used the map collection storing "Type Object" values many times without issue and then hit a problem yesterday trying to store(put) a Type object into a B4XOrderedMap. It also fails with a standard Map... Hence I suspect a dumbass programming error :confused: So I declare a type...
  10. C

    Android Question CLV , CreateMap - How i can get the specific Values

    I need to get the values that are mapped and do a routine to assign these values in a normal lstview. but I always return the last value in the index. and also I did not understand how I can pull the keys of the created map and assign to the item of the listview. 'dim mapaEscalonado as map...
  11. S

    B4A Class Get value from complex structure (combination of map, list, array)

    Hello, This is a module code to retrieve value from complex structure (combination of list, map, array and primitives types). Give the path with a dot (.) separator to get the value or the default value if not accessible. example : m=createmap("Name":"John" ,"Friends":array as...
  12. Multiverse app

    Android Question map assignment question

    I have a simple question. Dim mapGlobal As Map mapGlobal.Initialize mapGlobal.Put("Key1", "Value1") map2=mapGlobal Does the "=" the pass the reference of the mapGlobal to map2 or creates an object at new memory location?
  13. Mashiane

    B4J Question [BANano] [SOLVED] Map.IsInitialized Inclusion on map keys

    Hi there I was just cleaning my project and removed all .clear methods for my maps as I noted in the transpiled code that clearing them was not necessary due to to .initialize method just after 'dim m as map', thing is this has resulted in something else. This is what happens... When maps are...
  14. Mashiane

    B4J Question How to detect the variable type of a map value?

    Ola How do I determine the type of value a map value is e.g. string, map, list, int, float etc Is it possible? Thanks
  15. K

    Android Question list.size slowing down app

    I have json file which contain nearly 37000 record when I'm using : Dim list1 As List list1 = json.NextArray Dim exact_record As Int exact_record = list1.Size It slow down app. this work fine : Dim exact_record As Int exact_record = 38000 what i'm doing wrong?
  16. Maodge

    Android Question [solved]question on "Null"

    pls look at the following code dim map1 as map dim s as string dim o as object map1.Initialize map1.Put("4","d") map1.Put("1","a") map1.Put("101","a") s = map1.get(1) ' s = null o = map1.Get(1) 'o = null If s<> Null Then Log("s is not null") Else Log("s...
  17. nibbo

    Android Question List key sequence

    Hi All I use a webservice to return JSON data which looks something like: Data:[{"col1":"value1","col2":"value2","col3":"value3","col4","value4"}{…etc...}] I store save the above to the list: dim recordList = root.Get("Data") I then iterate through the list using: For i = 0 To recordList.Size...
  18. Pete_S

    Android Question Save Map To KeyValueStore, Load Map From KeyValueStore

    I created this code. It works but I was wondering if there is an easier/optimized way to save a map to a KeyValueStore and retrieve it back from the KeyValueStore. Main: Sub Process_Globals End Sub Sub Globals End Sub Sub Activity_Create(FirstTime As Boolean) Dim map1 As Map...
  19. analizer3816

    Android Question cannot get data in List & Map from java library

    I can't get size or data in list and map from java lib [I need java lib + b4a and use list in map , map in map, map in list or list in list] please suggest me for fixed this problem thanks this is my test lib java library code: ackage testlib; import anywheresoftware.b4a.BA; import...
  20. LucaMs

    Android Question JSON & Maps

    JSON generator / parser seems to convert maps' keys to string: Dim mapSource As Map mapSource.Initialize Dim i As Int For i = 1 To 3 mapSource.Put(i,i) Next Dim jg As JSONGenerator jg.Initialize(mapSource) Dim sJSON As String = jg.ToString Dim...