Android Question CameraSizes in List

Tyler

Member
Licensed User
Longtime User
Hey, I'm having trouble putting the "800x600" values in a list of Camerasize values into a format that I can display on a spinner. Anyone able to point me in the right direction??
Thanks!
 

DonManfred

Expert
Licensed User
Longtime User
No. I do not write the code for you.
But i can help you finding a better solution if you post YOUR CODE which does not work. What did you tried to solve the problem by yourself??? I don´t see anything in your post.
 
Upvote 0

Johan Schoeman

Expert
Licensed User
Longtime User
Hey, I'm having trouble putting the "800x600" values in a list of Camerasize values into a format that I can display on a spinner. Anyone able to point me in the right direction??
Thanks!
Something like Spinner1.add("800x600")....
 
Upvote 0

Tyler

Member
Licensed User
Longtime User
What I mean is, I can get the values of each camera size to populate in the spinner but as a string they're in the format of "Height=HH, isinitialized=False, Width=WW" whereas I'm trying to get the spinner to show something more user-friendly like "800x600". I've tried making the weird format stuff into a string and doing string.Replace on the bad parts but that's not changing anything.
 
Upvote 0

Tyler

Member
Licensed User
Longtime User
B4X:
        Dim pictureSizes() As CameraSize = camEx.GetSupportedPicturesSizes     
        For i = 0 To pictureSizes -1
            Dim s As CameraSize = pictureSizes(i)
            Log($"${s.Width}x${s.Height}"$)
            Spinnder1.Add($"${s.Width}x${s.Height}"$)
        Next
Im having trouble finding any documentation on the usage of the '$'(Dollar sign). Is there anything you may be able to point me to? Thanks again for the help Don!
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
of the '$'(Dollar sign)
it is just an easier way to work with strings.
B4X:
Dim pictureSizes() As CameraSize = camEx.GetSupportedPicturesSizes     
        For i = 0 To pictureSizes -1
            Dim s As CameraSize = pictureSizes(i)
            Log($"${s.Width}x${s.Height}"$)
            Log(s.Width&"x"&s.Height) ' without smart string literal....
            Spinnder1.Add(s.Width&"x"&s.Height) ' without smart string literal....
        Next
you can work without the smart literal strings too... But i like them so i often use it instead of normal sttrings.
 
Upvote 0
Top