Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
i am using rest services on my server with json response. In my android map i am using retrofit with gson to pull that data and store it in my custom list view. My question is what is the best way download data from my server sequentially, eg. first 10 items from the server and then when i refresh it by pulling the screen after those 10 items it downloads next 10.
It sounds like you're looking for pagination. This has more to do with your server than your client.
A typical way to implement pagination, is to have your server accept offset and limit parameters for a collection resource.
So for example, say you had a collection of items on your server that you could retrieve with
GET myapi/items
You would introduce the offset and limit query parameters to specify which page you wanted out of your collection.
GET myapi/items?offset=50&limit=25
Then you would program your API client accordingly to make use of the values.
You can roll your own paging mechanism on the server, or you can use something that fits with the language and / or framework you're using, which is probably a better way to go about this (best not to re-invent the wheel). For example, I'm using Spring, so use the paging features of spring-data.
This video has a fairly good explanation of paging starting at 53:00
https://www.youtube.com/watch?v=hdSrT4yjS1g
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
Basically, i used react.js for the front end and node.js/express.js as backend to be able to store and access data from my database(mySQL). I also used JAVA springboot to create my own api to fetch data from external sources such as JIRA with basic authentication. I was wondering if this is a good ‘structure’ in order to fetch data from jira, display it in a table and store it in my database. Now my other queston is, i run 3 local host servers to make this function, if i want to deploy and put all this in a web server would it make me need 3 servers running ? I’ve never deployed anything so my main concern is that. Thank you
I think you can put things simple and easy for you by choosing one language/framework for all your back-end process. Between NodeJs/Express and Java/Spring you can choose what you really like and are more comfortable with. Because definitely what you can do with one you can almost do it with the other. It is just a question of choice if there is no requirement.
About the second question, do you mean 3 physical servers ? It is possible to run all your three apps on the same physical server. You just have to set a specific port for each one.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
An example is like Trivago that searches other hotel websites then displays price, an image etc.
Basically what I want to do is create a meta-search engine that will search another website(s), then display the price of the (hypothetically speaking) hotel room and display an image. Also I'd like if the code will allow the info (from the other website) to be continuously refreshed. Please HELP! I am struggling and if you can provide a sample code I can use, so that I just have to put in the website. If you can't it's okay, but I need somewhere to start!! Thanks!
Data aggregators generally work in one or more of these ways:
Custom parsers for each data source (obviously, we can't answer this, as it is code written specifically for each page structure; probably easiest to realistically implement)
Data mining and AI (Google has huge amount of researchers working on this, you can't replicate it)
Providing an API for data sources to push data (since having data in a well-known aggregator is good for them; they probably won't use your API unless you show them it is beneficial for them to add code to push to your aggregator)
Using an API data sources provide to pull their data (only if they provide such an API, and if they authorise you to use it)
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I have a report generated from a database containing about 100,000 entries, each entry contains about 10 columns, the data is stored on Amazon S3 and is generated monthly. I'm looking for some pointers on a way you recommend a way to present this many multiple pages of data on, and I want it to be sortable and because however I sort it it wont suit all users, ideally it should be searchable as well.
Is it possible to do purely client-side or is that unfeasible, do I need go back to the server. I don't have the database available but if needs be, the website is backed by a java servlet application running on Tomcat. A self contained library for doing this would be very useful.
To paraphrase the discussion above.
Providing search/paging in Javascript is not sensible because this would still require the user to download all the data in one go, and representing that amount of data in html is not going to work well.
So either have to provide a server backend and provide a mechanism for searching and paging. Or provide the data in a spreadsheet format then the user can use the capabilities of their spreadsheet tool, which is well suited to dealing with large volumes of data.
Im going to try the spreadsheet idea.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am new to angularjs , can anybody guide me in performing CRUD operations in MYSQL and display in html form using angularjs... to be more precise... I want to store information to customer details such has name,consumer number,contact,address and update the same whenever necessary using java..
Hello and welcome to SO,
I created this diagram in order to make you feel more comfortable with the subject.
As you may see I didn't mention any language: Client, Server nor Database, because the language itself has nothing to do with REST APIs.
Instructions - begginer:
(If you are using PHP, I'd recommend SlimFramework, which is the light, scale, easy to start with, PHP Framework).
1) Pick a server-side language.
2) Create a Database Resource.
3) Pick a Server Side Language.
4) Create 4 Scripts that each does one of each:
Create,Read,Update,Delete.
5) Connect endpoints with each of the scripts, URL -
GET,POST,DELETE,UPDATE.
6) Verify that you can access each of them from the web (authenticated
or not).
7) After you verified that endpoints are working, time to connect
Angular:
7a) First try to create buttons for each action, and link it with
$http.get, $http.post, $http.delete, $http.put actions.
7b) Once it's working you might wanna step up and use ng-resource or
restangular.
P.S: I didn't supply much code information since once you understand what I stated on top, you'd realize that writing code for that isn't really hard.
After you complete these ,
You might wanna start with: Server side and Client side authentication, Performance, Multiple resources and collections, CORS and preflighted requests, and so on.
Good Luck.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I send request to web services and receive the results, then I need to allow users to sort the results. My question is that after retrieving the results where should I keep them to be able to sort them upon user's request without sending a new request using web services?
why again sending the request to web services i think no need of sending of request again once you received the result just store them in the type what ever they are and sort it mean while and get displayed to the users
You have two choices:
Let the server sort the results before returning them to the user.
Give the client the capability to sort the results on the client side without having to make another web service call.
This is a little bit tricky as there are several choices and you should use the one, depending on your need. You can store the data temporarily in cache or cookie if you don't require any permanent storage. Otherwise, you can use memory or database.
You can also check this link:
http://blog.mafr.de/2009/01/04/session-data-in-webapps/
It highlights some possible solutions.