How to reset my meal routine everyday with java spring? - java

I'm developing a diet App, and the user will have an everyday routine of meals, but how to know if "ok, today is a different day from yesterday, let's clear all the data of your meals and start a new diet routine".
Actually, I'm treating the Diet model as the one able to control this:
enter image description here
It has a localDateTime, that I'll use to check if the day has passed on, but is this the correct way to think and do this? Is this the way diet apps do this verification?
Tried to do this with the upper link and description ^

Related

Android show information in a specific day on calendar

Not a problem per se but I am figuring out how to do something. In my app, I shall save some workout for every specific client. Any workout will be doing different from week to week; i.e: rep scheme in the week one shall be different from the week two, and so on.
So, how to show the user that in the calendar? Should I save in every workout the day it should be performed and then see if it's the same day and show it? Or how to implement this? The only way I thought to implement this is save in every workout the day that it should be performed and show it in a textview and all the info behind relationated with the workout without calendar use but don't know if this approach would be the best
I have searched on the web but found nothing. If you could give me a hint would be awesome.
Thanks in advance!

Android in-app payment for physical items, where to store price information?

I am working on a Android app with the possibility to purchase a physical items. The payment will be implemented with help of the Paypal SDK.
Now i am facing a problem. I only offer two products which can be ordered. First one for say 10 Euro and the second one for 15 Euro.
Where do I have to place the price information which is then to be transfered to Paypal? I donĀ“t think hardcoding the price for my items
into the app is a good approach, but I did not find any better solution for it. I decompiled the app of one competitioner and saw that he also just saves the
price into the app?
Once i hardcode the price information into the app, how should I change it in future? Old app installations will always have
the old price? Lets say it was 10 Euro and now it should be 12 Euro?! How should I change that?
One possibility would be to get the price informaton from my CloudService each time the user starts my app?
What are other solutions for that problem? I want to be flexibel to change the price of my products and to be safe from manipulation.
(I would verifiy the payment with my CloudService and Paypal)
Regards
Store price on your Server this is the best way
You set pricing in Google Play Console.
Go to your application, Store presence, In-app products.
You can add your products and pricing info in there.

Tips for new Android app - maps, directions, transit

I'm not asking for anyone to build me an app.
I just need some tips on getting started.
So what I wanted to do:
be able to map some routes/directions, similar to what Google Maps already has regarding the local transit in a city.
Why? Because Google's database is a bit outdated, first. Second, because I want to create a local database with the routes and with the stations. Unfortunately, I can't really do that using Google Maps and I think Leaflet could help me with this much better. This would've been a web app, where someone with an account could add/edit/delete the routes.
create an Android app that :
a) sees the routes, allows an user to find the closest path to get from point A to B using only the routes I have in my database, sort by tram/bus etc
b) allows the user to mark a location and say something like "bus no 37 was here at hour:minute:second" - this would appear for anyone else that is using the app, similar to what another app lets you do this for police cars and traffic jams
c) extra: allow users to input some data so that my app could also give predictions; for example, someone inputs it took 10m50s to get from point X to point Y on route Z. That remains in a database and then someone else inputs some data for the same path...i would create some algorithm that could get predictions on where would a bus be now if someone marked it at Station 'bla' 5 minutes ago. I know, I know, this might be pretty hard, and it would be pretty inaccurate, I should consider the time of day, but it would just be something small, as an extra. Also, would be cool if this stuff could be added automatically: like the user sets the route he's on, starts "recording", then stops it when he gets off the vehicle and the time and locations are automatically taken into consideration.
Hope you understand what I have in my mind.
Thing is, what would you recommend?
I know Java, Spring MVC and a bit of Android. JavaScript, HTML and CSS won't be a problem. I need to combine these. If I will use Leaflet, as far as I can find, I won't really be able to use it in an Android APP, I would have to create a web app. At the same time, Google Maps doesn't really let me do what I want for my "personal" database. I can't even create decent custom routes by adding waypoints because parts of the Tramway Line aren't on streets with car access. ALso, would you think this is easier/better to do as an Android app or as a web app? I'm kinda new to Android.
I hope this isn't an unsuitable thing to ask on stackoverflow.
I'm open to any ideas.
allows an user to find the closest path to get from point A to B using only the routes I have in my database, sort by tram/bus etc
Routing is hard. Multi-modal routing (tram+bus+car+walking+cycle) even more so. See pgRouting and Valhalla. If you're going to do anything with public transport, then you'll have to deal with GTFS too.
Research into OpenTripPlanner also, as there are several actors developing some similar platforms.
I hope this isn't an unsuitable thing to ask on stackoverflow.
I'm afraid it kinda is - see https://stackoverflow.com/help/on-topic, point 4.

Java retrieve and compare two dates plus time

Basically I want to ask the user for a date and time of departure then ask the user for time of arrival to compare and get duration. I was wondering what kind of method of input would be good for this input. I was thinking either a multi drop down box or some kind of scrolling bar type deal. Can any one give me and suggestion on a good input method and what it is called? That does not require adding components or just asking the user to type it in, something simple.
Yes, using two dropdown controls (or a calendar control for the date) is a common way of handling this in a GUI.
Search Google for ideas, for example amtrak.com, or any travel website really.

Conversion with units, Java

I'm attempting to alter my program a bit and I'm having trouble. Basically what it does do (correctly) is that it outputs a cookie recipe based on how many cookie the user wants. It'll display the unit and how much of each ingredient the user will need for the amount of cookies he/she entered.
What I'd like to do is convert the units to an appropriate unit, if the unit exceeds half of the superior unit, needed before it displays the recipe. Example, instead of displaying 12 tablespoons of an ingredient, it'd display 0.75 cups. Example if it's over 1.5 teaspoons, convert to tablespoons.
I've gone over this many times, with friends too and I can't seem to make it work.
I'm looking for anybody who might have input to help me out.
These are the three classes I'm using:
My main : Not allowed to post since I don't have 10 reputation
Recipe class to display everything: https://gist.github.com/anonymous/3d6474fc0f3345fa4a98
Ingredient class (Handles conversions): https://gist.github.com/anonymous/008fc9d9d4bde1c88143
Check out Units of Measurement (for Java) http://unitsofmeasurement.github.io/

Categories