I have 2 SQLite databases in my android project, 1 is used to store profile details of users and another one stores book appointments. Currently the two do not link but work fine. I might sound a bit stupid, but is it possible to connect the two so when some clicks on the booked appointment of a certain user it will go to their profile. I cannot see a way how this can be possible and after spending quite a well I've not been proven right.
If it is possible, could I please get some pointers as how to go about doing it. I have unique id's in both that increment, and potentially the names would be same in both but I have no measures to check for links etc.
Sorry if I have not made myself clear, I am quite loss with this and having spent several days, the only way I can think of doing it is redesigning the whole thing and instead of having seperate databases, have one for both but only shoot off relevant content to the activities required i.e. profile details to one and appointments to another. Not sure whether this will work as well and I have already spent very long designing what I have!
I I suggest to export table(s) from one database to another one. it is easy and compared to what you are trying to do, is like a piece of cake. you can do this in SQL Server(i assumed it is your database) without have to code. but i stand correct if you need some of your data, you must do it with queries.
Related
I develop applications in AndroidStudio. For the first time in my life, I faced a problem - I was asked to make the application possible for use only within ONE country. I've thought all my life that this is configurable via the Google Play Console, but I've been told that it's not. Maybe someone knows how to implement such a restriction using a code only? Mb some changes in a gradle files?
You can use Locale to get the current country of users.
val locale = context.resources.configuration.locales.get(0).country
And you can make a request to a server to know users' countries.
For example, you can try: https://ipinfo.io/country
This is not an all-time work solution, but it's worth trying.
I have a system in Java where different classes stores different information. There is a main class where the user will input the information of these classes and make them interact with each other. After the user is done, he will exit the system. The Next time the user recompile the project, all the previously entered data should be there. The user can use that same data or add more information.
So Simply, How to pause/save the system on close and resume it when I execute it again?
PS. I can't use Database in this. It must be something else.
The Next time the user recompile the project
Users dont recompile projects. They just run your app.
You keep saying 'not DB', so, then, the answer is trivially: impossible.
A database, by definition, persists some data, hence the name: It's a base of data. If that's off the table, you're out of luck and what you want is not possible.
Perhaps you are careless in your wording there as well and all you mean is perhaps:
I do not want to bother with forcing the user to install a database
Okay, then, don't. Use an in-process database, such as h2. The user doesn't know an SQL-based database system is involved, all they see is a file appear. No extra processes are launched.
I hate SQL
Okay, then, don't. There are tools out there that turn an entire object structure into a bag o bytes which you can then save to a file, for example Jackson which can turn one object (which can contain all the relevant user data if you want) into JSON data, which you can then save to a file, and restore later. Of course, if someone trips over a powercable halfway through writing it, the file is corrupted. There are ways to fix that (save to .tmp, then move it into place, as that's usually atomic), but you're sort of committed to re-inventing the wheel here, due to your insistence you don't want databases.
I just want to save the entire system state
You can't. Not how java works.
Can't I do it with zero dependencies?
There's java's built in serialization system, which sucks, has a list of caveats as long as my leg on how to use it, and is more or less disliked by the maintainers of the java platform itself. This is not the way to go. It also still won't 'save the entire system state', it just saves one object, and does a much worse job at this than e.g. jackson.
Disclaimer: I am not a professional developer; I'm just a hobbyist, and a relatively inexperienced one at that, so I apologize for what figure to be some very basic questions. (and yes, I've search the forums)
I've recently been working on a "deal finder" program which is written using a combination of Java and R. The basic steps that I've completed so far are:
Load data on various deals into Java using a particular eCommerce API
Write the data that I need to a series of text files
Load the data from the text files into R
Manipulate the data in R and assign a "score" to each deal
Sort by score to produce a ranked list of deals
Here's where I need help: I'm currently running the program manually by running my Java program in Eclipse and subsequently running the R script. This is obviously inconvenient (and also a bit addictive), so what I'd like to do instead is:
Run the program continuously or at some predefined interval (say every minute)
Send a notification to my iPhone or (if that's too difficult) my desktop whenever
there's a new deal whose score is above a certain threshold.
The problem: I have no idea where to begin with the two tasks above. My coding experience is limited to a bit of Java and math/stat languages like R and MATLAB. I have zero experience with web/mobile development, servers, etc., but I am willing to learn. What I'm hoping to get from this forum is not a completely specified solution, but instead just some general direction. If someone can give me a sense of how this should be done, how much work it would be, what language(s) I would need, etc., that would be immensely helpful.
Two more things I should probably mention: 1) This program is only for my personal use, so the resulting application, whether it be on my phone or desktop, can have very minimal functionality beyond the ability to send/receive notifications. 2) If it makes things easier, I think I can eliminate the dependency on R and write everything in Java.
Any help will be greatly, greatly appreciated.
Two more things I should probably mention: 1) This program is only for my personal use, so the resulting application, whether it be on my phone or desktop, can have very minimal functionality beyond the ability to send/receive notifications.
You may want to use a third-party notification app like Boxcar and its Provider API for this, then.
Depending on your operating system, there are programs that allow you to schedule tasks to run. Cron in Linux or Windows Task Scheduler for instance. You can easily find guides for these online.
Have you considered using email? Rather simple to do from java and wouldn't be platform specific.
I searched in google and stackoverflow for my problem, but couldn't find a good solution. Below is the description,
Our Java web application displays search results from our local database and external webservice API calls. So, the search logic should combine these results and display it in the result page. The problem is, the external API calls return the results slower than our local DB calls. Performance is crucial for our search results and the results should be live i.e. we should not cache or persist the external results in our local DB. Right now, we are spanning two threads, one for the DB call and another one for the exteral API, and combine these results and display it on the screen. But it kills the performance of our application, particularly when we call more than one external APIs.
Is there any architectural solution for this problem?
Any help would be greatly appreciated.
Thanks.
You cannot display data before you have it.
1) You can display your local data and as they come, add via ajax other data.
2) And if there are repeated questions, you could cache external answers for short time (and display them with warning that they are old and that they will be replaced by fresh answer) and as soon as fresh anwer arrive, push new answer.
With at least 1), system will be responsive, with 2) usable answer can be available imediately, even if its not current.
btw, if external source take long to answer, are you sure that their answer is not stale (eg. if they gather some data and wait for rest, then what they gathered so far can go stale)? So maybe (and maybe not) short term persisting is not as bad as you think.
I have some issues with my parts of final year projects. We are implementing a plagiarism detection framework. I'm working on internet sources detection part. Currently my internet search algorithm is completed. But I need to enhance it so that internet search delay is reduced.
My idea is like this:
First user is prompt to insert some web links as the initial knowledge feed for the system.
Then it crawl through internet and expand it's knowledge
Once the knowledge is fetch System don't need to query internet again. Can someone provide me some guidance to implement it? We are using Java. But any abstract detail will surely help me.
if the server side programming is you hand then you can manage a tabel having a boolean in database which shows whether the details were read before. every time your client connects to server, it will check the boolean first and if boolean was set false then it will mean that there is a need to send updates to client other wise no updates will be sent,
the boolean will become true every time when client downloads any data from server and will become false when ever the database is updated
I'm not quite sure that I understand what you're asking. Anyway:
if you're looking for a Java Web crawler, then you I recommend that you read this question
if you're looking for Java libraries to build a knowledge base (KB), then it really depends on (1) what kind of properties your KB should have, and (2) what kind of reasoning capabilities you expect from your KB. One option is to use the Jena framework, but this requires that you're comfortable with Semantic Web formalisms.
Good luck!