Hi guys.
Trying without success -
As u will see in attached file, i have for example the column “PropertyTypes”.
it holds 4 string values in it: “Any type”, “Apartment”, “House”, “Room”.
What is the best / right method to do it? What is the right query i should use?
How to take strings or integers from a column and put them in Array that will be possible to run a
“for” loop on it?
Here is my DialogOptions.java:
public class DialogOptions {
private String PropertyTypes;
private int NumOfRoomies;
public DialogOptions(){
}
public String getPropertyTypes(){
return PropertyTypes;
}
public void setPropertyTypes(String PropertyTypes){
this.PropertyTypes = PropertyTypes;
}
public int getNumOfRoomies(){
return NumOfRoomies;
}
public void setNumOfRoomies(int NumOfRoomies){
this.NumOfRoomies = NumOfRoomies;
}
}
For some reason the image doesnt show… It shows that it was uploaded, but i cant see it.
Anyway - if the image doesnt show so to make it more clear:
the table name is “DialogOptions”.
One column (Strings) is “PropertyTypes”.
Second column (integers) “NumOfRoomies”.
Thanks again!
Hi Yariv,
Here’s the code to do it:
final ArrayList<String> propertyTypes = new ArrayList<String>();
final ArrayList<Integer> numOfRoomies = new ArrayList<Integer>();
Backendless.Data.of( DialogOptions.class ).find( new AsyncCallback<BackendlessCollection<DialogOptions>>()
{
@Override
public void handleResponse( BackendlessCollection<DialogOptions> dialogOptions )
{
Iterator<DialogOptions> iterator = dialogOptions.getCurrentPage().iterator();
while( iterator.hasNext() )
{
DialogOptions dialogOptionsObject = iterator.next();
propertyTypes.add( dialogOptionsObject.getPropertyTypes() );
numOfRoomies.add( dialogOptionsObject.getNumOfRoomies() );
}
}
@Override
public void handleFault( BackendlessFault fault )
{
// TODO: make sure to log the exception, just in case
}
} );
Hi Mark.
Ok! Will work with this code and see how it goes.
Thanks a lot!
Question: Is your Dialogoptions Table content static or are you adding rows to it regularly?
Hi there.
I will add more as i go. It will contain more columns, more content.
Got it working finally
Thanks a lot for the help Mark!