I want to build program looks like this.
I'm getting confused how i can build it like this. The only possibilities in my mind is only using ListView. But really i already searching in many sites how to make it looks like this, but i didn't found it.
So that i already give the mark in the picture. That data is coming from database. So for the example in the first record contain Ship-001 , CDD, Indah Transport, 5 Nov 2015. And the second record is Ship-002, CDE, Buana Karya, 6 Nov 2015, and so on.
Could u help me to provide me about this ?
so a listview use data in the form of array. every item in the array, will contain one record, for example, item 1 contains ("Ship-001" , "CDD", "Indah Transport", "5 Nov 2015").
then use the list view to show all the items.
this is a great tutorial for listview
list view tutorial
Related
I'm trying to filter a JSON url results using App Inventor 2, following sample codes from here1 and here2, but I still cannot get it done right. I only get one result at a time.
The JSON results are data in the form shown in the following figure:
{
"field1":"alphaNumeric1",
"field2":"aNumber1",
"field3":"DD/MM/YY",
"field4":"HH/MM/SS",
"field5":"https://",
"field6":"aText",
"field7":"aNumber2",
"field8":"alphaNumeric2",
"field9":"aNumber3",
"field10":"alphaNumeric3"
}
The JSON url is constantly updated, so are the results, but this is not a problem for now. I can get it read by a timer.
The problem is that from the above results, I need to parse "field2", "field5", "field6", in according labels in the app.
So e.g., when I input a "aNumber1" to get searched in the JSON data, and have the result in a label.
Is it possible this JSON data search be done with App Inventor 2?
Anyone kind enough please answer with a sample blocks if possible.
Thank you all in advance!
[EDIT 1]
No matter what I've tried, JSON could not get filtered right. Therefore I'm to filter the url results in XML.
The XML results are data in the form shown in the following figure:
<results>
<decision>
<alphaNumeric1>ABC1D</alphaNumeric1>
<aNumber1>ABCD</aNumber1>
<aDate>123</aDate>
<doc>HTTP</doc>
<aNumber2>1234</aNumber2>
<alphaNumeric2>TYPE</talphaNumeric2>
<aNumber3>12345</aNumber3>
<aNumber4>1234567</aNumber4>
<aText>SomeText</aText>
<aHour>00:00:00</aHour>
</decision>
.
.
.
<decision>
.
.
.
</decision>
.
.
.
</results>
I have tried to follow the example at here2, but I don't get it right. According to the XML output, what should I put in starTag and endTag, to get a parsing result if I'm searching for e.g. aNumber4 value (= 1234567) ?
Can someone respond with an answer?
[EDIT 2]
Well I'm trying to make some progress here following the example at here3.
The XML is being parsed with a runtime error "this is not a well formatted list of pairs".
Following is the blocks code I'm using:
Why is that so, since I'm following the example to the letter? Any clues anyone to solve this out?
well, your blocks look a little bit strange...
you have a complex list of lists, just use Do it to find out, how it looks like after each step of using lookup in pairs...
It helps to follow the already provided links:
how to work with lists
how to work with list of lists (pdf) by appinventor.org
see also An example of a complex List of Lists
In the example blocks below I looked for the first <decision> and displayed the value of tag aDate in Label1 like this
you might want to loop through the different <decision>s using a for each in list loop....
I'm using parse to get a number of places into a recyclerview.
The problem is it's quite slow, which probably has to do with my workflow.
In the RecyclerView I show: a picture, some textfields, tags, how many likes a place has, and how many comments.
For this I query my Place object, which has relations with a picture object (which holds a ParseFile), tag objects & comments object.
Getting 10 places like this takes about 10 seconds, this seems to be extremely show.
Worksflow:
in a AsyncTask I have a query to get all the Places.
I do a for loop on these places and per place I get the relations for the pictureUrls, tags & comments. (These are loaded into arraylists to pass to the adapter).
By the way, in the adapter the pictures are loaded with Picasso.
Any help on this would be appreciated :)
I solved it, for now.
What makes getting the placeobject slow is iterating over each object, getting the relation with picture object, tags & comments.
I dropped this iteration, instead I:
pictures
- I stored the url to the thumb in my place object, I load this picture with Picasso
comments
- I added a field "commentscount" and increment this everytime there is a one. I just needed the count, so this is enough. (I show the comments in the detailfragment)
tags
- I dropped the tags, and I will show them in the details too.
So, dirty fix maybe, but it might be just what this problem needed.. :)
I find designing my android App really hard. Don't even know where to start. I just want to make a simple table like this:
didn't allow me to post a picture.
here's the link:
It has to be created with code since the 5 rows(15/04-15 - hverdag -1337 - 3 -2 and so on) are depending on how many registered hours the person has created in a time interval of a week. So it could be 1 or 100 rows.
You can easily manage your task by creating columns in a listview, and you can populate its adapter via data from anywhere you want. Here are some links for showing that stuff :
For creating a multicolumn ListView from this link.
and for showing how to populate your custom adapter follow this link.
Hope this helps.
I'm programming an Android app that shows data from MySQL database via ListView with some sorting:
1) Items that are closer to android phone by GPS are shown firstly
If there are 2 or more items with equal distance, second sorting parameter applies - time.
2) Items that are closer in time are showm firstly.
Here is a scheme of the process that I guess to implement:
My idea is to get all needed rows into Array, then make some PHP manipulations with it and then pull sorted Array to the phone.
(as shown on the image above)
So please advice me what will be the proper way?
Maybe there is easier method for this functionality?
Or maybe I should do all the sortings exactly in the Android app when programming ListView, getting only standard "SELECT *" array from the database? Then, is there an opportunity to create a ListView with sorting based on calculated values?
I'm working on application and I need some suggestions which is the best way to code it for Android. Basically it's something like event guide for a few cities. Imagine this :
I have an activity with 7 different buttons (7 different cities) and clicking on one of these buttons I'm opening a new activity where I have all months (January-December) as buttons again. If there is some event in February for example in the chosen city the button will be active and I will go to another activity where I have a list with the events. So my idea is to do it in this way :
Create one Activity with all Cities
Create one Calendar activity with all months.
When user select for example Paris, I'll send an extra via intent with an ID of the chosen city :
intent.putExtra("chosenCity", 2); //something like this
In the Calendar activity I will make active/inactive months buttons depending on that extra sent from Cities activity.
And when user chose a month I will send that chosenCity extra again to the ListViewEvents activity and populate the list view from Database (for example) depending on that extra.
So my question is : is it a good way to build an application like that? Or if it's not, which is the best way to achieve this?
Thanks in advance!
Sounds like you already know pretty much what you need to do. The only thing left is to implement it. The only thing I'll add is that your should probably store all your database and use a CursorAdapter to display them in the ListView. You can store all the events in the database and just create your select statement in such a way that it only selects the events you want to display at any given time. When using this CursorAdapter, I highly recommend you use the CursorLoader.