AutoCompleteText with API Result android - java

I have An AutoCompleteText in my android application that's take it's list from web services and my records in database going to be a big data like more than 100 thousands, and I can't do pagination because it's not going to give me correct suggestions, and i can't make a listener to do filter in web serves because it going to send too many request in less than second , what is the best way to do it , I am using laravel in server side and java for android and volley for API http request

Related

How to send a notification to a AngularJS app from a Java app

I have a weird problem. I have an angular app which should display data from a Java Rest API. My java rest API doesn't have all the time data because this data comes from others systems.
So I need somehow to notify Angular app if I have available data in my API and to make a request to a specific resource.
Something link this:
Other Systems sends data -----------> Java API receives data
Java API ---------------------------> Notify Angular about new data available(e.g POST x.x.x.x:4200/notifications)
Angular makes a request to ---------> Java API for the new resources (e.g GET x.x.x.x/api/newData)
I don't know how I can notify an angular app about this new data because in order to do this Angular should behave like a server.
If anyone has some ideas regarding this problem and maybe other suggestions it will help me very much.
Thank you.

integration of Android with servlet or mysql database

I have made school management software...for the server side I have designed the admin panel using servlet and jsp technology.and have used mysql database and for the client I have created an Android app. I want to perform login and logout authentication and fetch data of that particular user on his app.. but I m unable to integrate. I need to know what are ways through which this thing is done professionally....
Thanks in advance
At your backend side you have your servlet which handles incoming requests GET or POST. So in android app you just need to make call to your servlet and handle the response.
In android
1. Get the user credentials and pass it along with your request.Either make GET request and append your credentials to servlet url or pass the parameters as POST request.2. To make network calls use libraries such as Volley, Retrofit or you can even use android built-in AsyncTask.(If you are a beginner start with AsyncTask first and then upgrade to libraries mentioned).
Professional way is to develop REST apis at your backend and call them from your android app.

How can we add a server-side Java code in Firebase?

Scenario:
I am planning to build a system that has 2 components. A Web App (Angular) that would push some data to Firebase. Before the data gets pushed , I want it to get validated by a server-side Java code. The data getting pushed to Firebase is fed to an Android application that consumes the data from Firebase. The Android user can perform some actions like changing the state of data. Before the data gets changed again there should be a server side code to validate it.
Question:
Where does the server-side code reside? Do we need a third party Web App hosting service other than Firebase?
If my code is in Java 7, what can be the possible options available?
If at all we use a third party server, how does the server communicate with a Firebase server?
Also can you please help me understand (if possible) how can we make sure that the data getting pushed to Firebase server gets validated by the server-side code before getting pushed?
firebaser here
You can interact with the Firebase Database through its Java SDK.
Firebase does not currently provide a way for you to run your (Java) code on our servers. We've covered this many times already, so I recommend reading up here: Server Side Calculation using Firebase
So you'll indeed have to host that code at a third party. Recommending a specific host is off-topic on Stack Overflow, but there are undoubtedly a lot of results of you search for Java hosting.
A common way to have server-side validation before sharing the data publicly is to have two separate lists.
moderationList
-K.....1
title: "how can we add a server side java code in firebase"
body: "Scenario: I am planning to build a system..."
messageList
-K.....2
title: "Firebase and backend logic"
body: "I am parse.com user, and now I look..."
Your users view messageList, but they write their items to moderationList. Your Java server code monitors this list, validates the item and then adds the item to messageList. This is a common queue pattern that we use a lot internally at Firebase.

How to add the data to Google Analytis by using java (programmatically)

At the current moment, I am trying to understand how to add any data to GA. I read the data from my GA account using Core Reporting API and Managment API without any problems. But now I want to add the data (the number of phone calls) to GA account programmatically. Somebody can explain me step by step - how can I do this?
The Measurement Protocol is how we send data to Google Analytics. The JavaScript snippet that we use in our websites also uses the Measurement protocol as do the SDK's for Android and IOS. Unfortunately there is no (official) SDKs for the other languages like Java for instance.
That being said you can technically code it yourself in any language that can handle a HTTP get or a HTTP post. I have personally done it for C#.
POST /collect HTTP/1.1
Host: www.google-analytics.com
payload_data
The following parameters are required for each payload:
v=1 // Version.
&tid=UA-XXXXX-Y // Tracking ID / Property ID.
&cid=555 // Anonymous Client ID.
&t= // Hit Type.
A few tips to get you started.
Check out validating hits this is very useful in the beginning for debugging your requests.
some of the parameters are only valid for certain hit types. Make sure you check the documentation.
Cid is just a string it can be anything most people send a Guid its basically used by the server to identify a unique session.
if you are doing this for an application google analytics account remember to send screenview not pageview the same goes for web application.
check the realtime report on google analytics to see if your hits are getting recorded.
Update for question in comment:
I recommend while you are getting the idea of this you start with just using HTTP GET in a web browser. Its easer to test your requests against debug that way. For example put this in a browser.
https://google-analytics.com/debug/collect?v=1&tid=UA-123456-1&cid=5555&t=pageview&dp=%2FpageA
DP is document path and I am not sure why it is requiring that you send that.
ScreenView hit type VS PageView hit type.
There are two types of Google Analytics accounts ones for applications like android applications or sometimes web applications, and web sites. Application Google analytics accounts are meant to be used with ScreenView hit (the user checks a screen in the application) type and web accounts use PageViews (the user views a webpage). If you send a Pageview to an application Google Analytics account it will accept the hit but there will be no way for you to see the data. If you send a ScreenView to a web Google Analytics account it will again accept the data but you wont see it.

How to send data from android to java application on server

Hi I want to send data from my android app to server and store in the Mysql database. But I want to use REST method to send the data and I want to create a Java app on the server side that will show the data in table format .
I have created the android app but don't know how to upload data using REST. The data which I want to send is latitude and longitude of current location.
And after refreshing the java page new data will be viewed on the page.
Please tell me how to do this task.
Thanks in advance.
You can use some framework to communicate with a server. I think retrofit is the best choice for REST API: http://square.github.io/retrofit/
But you can try the Volley. Or the HttpUrlConnection and DefaultHttpClient in android sdk.
This is a big question that would need more space than here to cover. To get started you could try looking at the spring boot or drop wizard frameworks for creating your REST service.
Coursera also has a course programming web services that might help you get started.
Alternatively, there are services like Parse that look after the backend process for you.

Categories

Resources