i'm kinda new to this, but i have been doing some research about how i could retrieve the current date and time of an ms sql server(not to be confused with retrieving a datetime column) and display on a textview, the main reason why i'm trying to achieve this is to display the current date and time of the server and avoid confusion due to changing of date and time settings on the android device itself.
i have been looking at different posts here in stackoverflow but none of those seem to produce the result i'm looking for, if incase i overlooked the proper post that has the answer that i need, please do tell me so i can mark as solved :) thanks
i really just want to know if this is a dead end and not possible or there is some kind of code or third party library that allows this... thank in advance, all feedback is appreciated
GETDATE() OR CURRENT_TIMESTAMP will gives you the current date & time in the SQL Server
Related
First of all, I know that there are many questions like mine. However, I cannot understand that solutiona or they just doesn't work. So, I don't need the date and time from DEVICE. I need the real date and time in the Asia/Tashkent. Also i tried the way with
DateFormat.getDateTimeInstance():
This one shows device date and time too. In other words I need the date which user will not be able to manipulate by changing device date. At least just advice some useful APIs e.t.c.
I know that there is a lot of such kind questions. Also, please, explain which part of the code is used for what.
This solution seems simple to me. Give it a try.
I am currently using a TimePickerDialog in order to receive a length of time to count down from. The problem is that I need it to be possible to select 0 hours and some number of minutes from the TimePicker. I have been unable to locate any information on how to modify the TimePickerDialog class in order to make this happen. Any help would be greatly appreciated. If easier methods (that still look good) of receiving length based input exist, any links or information would also be awesome.
You might be looking for NumberPicker widget, It enables you to select a range of numbers including 0. Take a look at this question question
First time I am trying to do something with alarm/notifications in my app.
I have dates in my SQL Database and I want to trigger notification on all those dates.
People might find this as a duplicate, Sorry for that but all the questions I came across till now had half written code along . It was difficult to understand.
After referring so many questions and tuts now am confused from where to start with.
So, please can anyone help how should I move on from here. I have all the dates in table in the string format.
Simple
Provided that you know how to query these dates (if not please say so and i'll update my answer accordingly) you can do one of the following:
Add your events to the Google Calendar programmatically and allow the predefined Google account and its notifications preferences do the work for you (example on how is here).
Schedule you own alarm events and when these are called show your own UX (example for a lead to start from here).
Goodluck.
For my project, ppl can give an answer to a certain question they get. I perform userAnswer = etUserAnswer.getText().toString().toLowerCase(); on it and then compare it to a value that is stored in the SQL database.
But I was thinking that it is quite annoying for a user if the answer is just almost correct but if he has written 'kk' in a word instead of 'ck'. Therefor I am trying to create a system which checks if the answer is more or less correct and then returns the result of this. I searched the net but don't seem to find anything on this subject. I also don't know if such a system has a certain name in english?
Or.. maybe somebody knows a good tutorial or a good way to get started?
I guess you're looking for the string distance, for which you could e.g. use the Levenshtein Distance. For alternative metrics, see this question
I wanted to create a reminder app for my android. Actually I wanted to save reminders and the dates in the database and show the reimnder when the scheduled time is reached. Can anyone please suggest the code for this. Can alarms be given specific id at the time of saving and used to retrieve the specific reminder from database. I am new to android. Please help me.
Yes.. Your question is to broad for stackoverflow. But i would suggest you picking up a copy of Android For Dummies
This has a full tutorial of exactly what you are looking for.
You probably want to use Notifications in conjunction with the AlarmManager. There are lots of tutorials on the web that explain how to do this. Here is one: http://android.arnodenhond.com/tutorials/alarm-notification