Making a request to end points wrong [closed] - java

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 4 years ago.
Improve this question
I submitted my project about fetching popular movies data in Udacity, and when i saw my review there was one thing to change, "The end points are perfectly implemented and fetches the correct result every time a request is made. But there is a small problem that instead of making a request to end point top_rated you are making a request to vote_average which makes it fetch wrong result!" But when i change to top_rated, the app doesn't fetch at all what is the problem? I don't get it, it fetches perfectly like this,And I don't see in the moviesDB nothing in JSON that says top_rated..
ScreeenShot
Information about the Project>> https://docs.google.com/document/d/1ZlN1fUsCSKuInLECcJkslIqvpKlP7jWL2TP9m6UiA6I/pub?embedded=true
My project >> https://drive.google.com/open?id=1wxYsxio2kbo44anndE9_93h13pWKTk0J

What does your json look like thats coming back from the url.
It looks like you also never make a request to
http://api.themoviedb.org/3/movie/popular?api_key=[YOUR_API_KEY]
based on your code and the project it seems like you need to fetch the top rated, then add it to your movie object.
in the project description look for Stage 1 - API Hints

Related

Checking server-side ad viewing (php) [closed]

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 2 years ago.
Improve this question
I have an application using php backend. Let's say this is an app for cheating views on YouTube, or something else where points are very important. I want to realize crediting points for viewing ads, but don’t know how to do it. Of course, I can send a request to the server when an advertisement has been viewed,
#Override
public void onAdOpened() {
if (sampleInterstitial != null) {
//something code
}
}
but I'm afraid that a person rummaging in the code of my application will easily find which request I am sending and will be able to easily emulate my requests for building up points. How can I avoid this? For example, is it possible to somehow check from the server whether an ad was viewed? Thanks for answers)
First of all the client cannot check the server side code , you do something like getting the ip address , time .. etc of anyone who views the ad , and inject it in a database or a file , and in this way you can know how many people did and give it credits
Your Php Ad page :
$ip = $_SERVER['REMOTE_ADDR']; // gets ip address
$time = date_default_timezone_get(); // gets time
// insert it in your file or database

Rest Api design: resource archetypes, store and controller [closed]

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 2 years ago.
Improve this question
i am currently in the process of looking more closely at the design of truly restful services.During my research I read something about resource archetypes at rest, four different types of archetypes come up frequently in discussion: document, collection, memory and controller. The first two I understand without any problems, but the last two I don't really understand. Can someone please give a clear explanation and example for both? Thank you.
Sure, there are four main archetypes at rest, the two that you're asking are:
Store: It'll never generate a new URI, we'll use the next URI http://api.example.com/song-management/users/{id}/playlists a user can PUT, GET and DELETE any playlist from its account but this store, the store is always managed by the client.
Controller: Are like functions, when HTTP verbs can't say the action which a resource will do, you should use this archetype. Eg. http://api.example.com/song-management/users/{id}/playlist/play will starts a playlist.
resource: https://restfulapi.net/resource-naming/

What is the most efficient way to use database? [closed]

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 5 years ago.
Improve this question
I'm new to using a database, specifically MySQL. I'm creating a web application for class in which you can look up the name of a book and it'll display the summary of the book. My question is should I send a query to the database that collects all of the books' data on initialization and put them into a HashMap inside a manager class for lookup or should I use a query each time to lookup a specific book information?
It depends on the data transport time I would say. If your average query time times the number of request goes faster than a script to put everything into a HashMap, use queries. Otherwise, use a script that collects everything and puts it into a HashMap.
But if you have thousands of rows, you should use queries, because otherwise you will use too much RAM.

Making the user follow specific steps [closed]

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
Am not sure if the title describes what I want. Am developing an App on Android where kids start a new empty drawing project and finish with a full drawing at the end by dragging different shapes from a list of shapes that I created for the App. My problem is that I dont know how am going to follow the kid steps.
The kid is supposed to read a message in each step and try to apply it and then click on a next button to view the next step.
I want to make sure that he do exactly what the message is saying in order to view the next step.
Theoretically, how is this applied in Java ? If for example, there would be 20 steps how can I make the app follow up with him and make sure he is doing the right thing
You are looking to create a wizard. In Java use a MVC libray Spring-MVC or if its android you can use similar approach. Basically you want steps and views while saving the state - typical MVC pattern. Have a model object that is passed along to the views. Each view will have portions of the model that it can read/write to.
Android -refer to WizarDroid.
Spring - AbstractWizardFormController will help

Efiiciency for Pagination in Java [closed]

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
I am writing Pagination for a set of records in Java. Here i am talking to a service which fetches a result set of 500 per time. I interact with that service to display at most 50 records at a time with page markers.
Is it a really efficient model or if there is any other way to improve the suggested pagination model ?
Depends on your data.
If your data is rapidly changing, this definitely isn't a suitable method. I would suggest tweaking the service to return only as much requested records that are needed by the page.
If data is static and need not be time dependent, this should work fine. Just fetch the 500 records, put it in a local array and display from there. Once this is exhausted, replenish the same.

Categories