简体   繁体   中英

How do I turn my Java program into an “app” that can send push notifications?

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:

  1. Load data on various deals into Java using a particular eCommerce API
  2. Write the data that I need to a series of text files
  3. Load the data from the text files into R
  4. Manipulate the data in R and assign a "score" to each deal
  5. 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:

  1. Run the program continuously or at some predefined interval (say every minute)
  2. 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.

  1. 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.

  2. Have you considered using email? Rather simple to do from java and wouldn't be platform specific.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM