React - Java Backend - Sync New Data - java

I'm having a small problem with a personal project, I'm trying to create an auction site in React - it's an amazing learning experience - with a Java backend.
One trouble I've stumbled upon is how to "sync" data effectively, when new data is inserted into the database from a different user, such as if a user would bid on an item, how would other users update their data?
The only way I can see it happening is with a push model, or constantly polling for data from the server. Both seem pretty out of reach, to be honest, although the push-model seems the more likely of the two.
I could somehow set up an observer pattern with users "registered" when viewing an item, although if there is a better method, I would love to hear it.
I already tried searching for answers, but either none exist (I doubt it), or I'm simply terrible at using Google and don't know the keywords to search for to get the specific results I need. (Likely)
Thanks in advance!

You are looking for a kind of server push technology. Try researching more into Websockets or Server-Sent-Events.
A start could be: WebSockets vs. Server-Sent events/EventSource

Related

Searching for CRUD tutorials

I am sorry for my terrible English.
I ask for help with the following task: write a web application that would execute sql queries to the database: select, update, insert and other basic operations. About the interface - the text field where the request is entered and then performed after the click of a button. It is also required to provide registration pages, plus different functionality for the administrator and the regular user.
From the "technique" it is recommended to use Java + Spring Framework, TypeScript + Angular, MySQL. However, the problem is that from all that list I have worked only with Java and MySQL. In short, I have a little experience with the front-end (HTML, CSS, JS), but haven't yet tried working with back-end. So I am completely newbie with all this.
Therefore, I ask for help with some good tutorials on this topic. Alas, there is no way that I could raise all this from scratch. I just have no enough time for it. Please share with me tutorials that really helped you and do not throw the first links from Google. I am able to find those in a search engine myself, but I regularly find outdated or too complicated for a beginner.

How to take a webpage's content to create a native app for it? e.i not just a webview of the website

I want to create an app for a website that I don't own, like youtube or reddit. Every time I search for help, all I keep getting is how to create a webview. I've done that but that's not what I want. I want to take the website's content and create an app with it, like create my own buttons and such. I want to convert a website into an app.
I was thinking of somehow loading the website in the background and creating activities/buttons/intents that basically do what the webpage does but I don't know how to go about that or if there's a better way.
Thank you in advance.
Please let me know if clarification is needed.
Alright i got -3 votes for some reason and it has been 12 hours since i posted this question, i'm guessing the question has been consumed by the abyss of questions by now.
I made a reddit post and got some responses:
one user:
The term you’re looking for is “web scraping“ or “site scraping”. I think that’s probably what you need to research before you’re ready to handle how to make that into an app.
That’s a good starting point and once you have the content from scraping, making the app is no different than any other app.
second user:
If the website has a public (or private) API, you can use your buttons and networking calls to their API to build your client app. You are building a "YouTube client" in this case using the YouTube API.
If they dont have an API and you don't want to display their website, what you are doing is trying to reverse engineer their website and hijack the UI which is not a good practice and may even be illegal depending on the site and terms.
third user:
#second user is right on the money, but one thing I'll like to add is, the goal is to get data off of the website so that you can use in your app. An API is one (convenient) way of doing that but others are,
RSS or similar feed content (prefer this if there website supports)
HTML scraping
The above two will require you store the data somewhere else (and possible expose an API instead) because of technical reasons: you don't have access to older entries in RSS feeds and it's atrocious to keep on scraping everytime you need to access the website data. They can be done on the client (mobile app) but are best done on a server. This means you might need to get your hands dirty writing server code but you don't have to.
/thread
I'm going to do research on website scrapping and APIs to see which route i should go.
Hopefully this helped someone else.

How to send multiple parameters from android app to search in database?

I am creating simple search application. I have search parameters in ArrayList that I want to use to make search in database. Every single time size of ArrayList would be different. I already have most of my application completed and this part made me completely stop.
I use Volley and my PHP for getting JSON from database and I read that I could also send parameters by Volley, but don't think it would work for me.
Friend told me that only way to make this is to use services (I still trying to understand what they are). I tried researching Django, Spring, but I cant understand what I can use them for, I'm so confused about this part.
I want to ask for your guidance for my specific problem, because I don't even know what I should be paying my attention searching in Google as there not so much tutorials for Spting framework or Django or other methods.

Automating movement on a webpage

Well, I'm kinda new to mobile app development, but I have a fair amount of experience with Java. I stumbled upon CodeNameOne and thought I'd try to make an app based on "It's Learning". Unfortunately this site won't let me get straight to the logon page without going through the main portal first. So here's my question:
Is there any way (in CodeNameOne) to automate navigation on the web in the background and get information from the site, such as login and the newsfeed, then send data from the app and to the web page?
(Something like the way HtmlUnit works is what I'm looking for)
You can do some of that work using ConnectionRequest to simulate user interaction but that would probably be fragile as Andrew mentioned. The main issue is that they might change the site structure and your HtmlUnit code would break.
What we do when faced with such a situation is create a server that abstracts the "scraping" behind a set of clearly defined REST API's. That way if the site design changes we just update the server to match the change and all the clients out there will work as usual without requiring an update.
Naturally there is always a possibility of the site blocking you or even blocking your server IP address/range so Andrews advice of actually talking to the guys is sound advice.

How to manage online users in IM applications such as GTalk, Skype etc

Do they keep an online user list in a database and update it with every login and logout event, and run queries for online friends?
What about scalability?
Are there better solutions?
If you try to either store presence in a traditional database, or poll for changes to anything, you're going to have a tough time scaling your presence system. Start with one of the open source XMPP servers, pull it apart, and see how it works. Each one of them scales differently, but at least you'll understand more about where you need to start.

Categories

Resources