Pulling my profile picture from Twitter using Auth/twitter4j/Eclipse - java

I'm looking to build a web service using twitter4j which will allow me to get my profile picture from twitter and print it out somewhere.
My initial plan is to use Eclipse and Heroku/Git. I'm just a little unsure of the steps to take to accomplish this... I'm in no way new to coding or Heroku/Git, but I am fairly rusty when it comes to Java, and Java is the language I need to use.
Would anyone be able to suggestions how I would go creating the service I have mentioned above?
I have even cloned these 4 example web services here to my desktop and then opened them in Eclipse, with the intention of changing/removing/adding whatever code I needed to in order to accomplish my task but I get endless
'Cannot be resolved to a type'
errors. I'm assuming this is because I need to install libraries/JAR files in my Java project.

You don't need to use the Twitter API if all you want is the user's image.
You can use a service like http://avatars.io/
Simply call http://avatars.io/twitter/edent to get my avatar.

Related

What does one do regarding applets now that Chrome doesn't support Java?

Without thinking, I created an entire program in Java and began designing a website to use this applet. All it does is create image in a certain way but there is a bit more code (classifications and default values/images) that I just felt was easiest to do with Java. Now I have a Java app and HTML CSS and JavaScript that I can't seem to do much with.
I have thought of 2 ideas (below) but I don't know what the general alternative is to applets nowadays.
I have a spare PC I may use and just alter my applet to run the back-end of a server-based site instead, but I am hesitant to use my own IP and bandwidth for something like this. Also, this app doesn't even need access to the internet so this just seems like way overkill.
I could just release the .jar, but I plan on expanding the available options. I also told people that this website was coming. I'd like to be able to just update the website.
I don't really plan on writing my program in another language. This took me time to make. If there is no way to work Java into my site, I may just abandon the project altogether.
I am mainly concerned with Chrome for this problem.
Edit: I would like to use GitHub as my host, just in case this helps at all.
You can run anything you want on the server, including java programs. So
you could run the image creation program in the server and present the
resulting image using a standard img tag.

Running A Java Eclipse Project on a Cloud-based Server with external Libraries

I hope this is the right place to post this question. The web applications stack exchange did not look suitable based on the other questions asked on there so I guessed this might be the best place to put this question.
I have a java eclipse project that works as I would like it which takes in an image locally from the adjacent file path and performs the required action on this image before returning a double value at the end after all the calculations. To do these calculations I use the OpenCV library which is essential to the core functionality of the application.
The issue I am having is to deploy this application so that the the application when it receives a request will take in an image (preferably as a .jpg but this can be changed if absolutely essential) and then after the application has carried out the required task send back the resulting number. In future this will be sent and received by an Android app which will just take the photo, compress it and send it away before receiving and displaying the answer but for now I'm just trying to get my project onto an accessible server.
I have tried to use Heroku and followed their tutorials and instructions which encourages the use of Maven but I could not properly insert the dependencies for my project as it used an external jar. I spent a lot of time checking through the various solutions online to this issue but a lot of them felt like workarounds which only worked in some cases and none were working for me. I am open to using this again if there is an elegant solution that is simple to follow.
The main sections of this question that I am asking is for the simplest way to take my working eclipse project which uses an external library, modify it to take in an image via server request and then send back a number result. I also would like a suggestion as to which cloud-based service would be suitable for this project and allow me simply to put my code on their service and allow a test user to run this code whenever I want with reasonable availability.
Sorry for the long-winded explanation and I hope I have provided enough information. I have been trying to work out how to do these things with the help of tutorials and suggestions for a few weeks now but have no previous experience with making a web server as everything I have created has been a local program.
Thanks for your help and suggestions

What are the steps to upload a java web application

After a lot of work i manage to finish a java web aplication with netbeans using primefaces/glassfish server (it is a e-shop that we developed for a school project). I use xampp (mySql) in order to fiddle around with a database that i use in the web app.
My problem is that i have no idea on how to upload this to a server. What am i supposed to install on it ?, i dont even know what os to use :/ . Im really bad at the "internet part" of this project and since this was my last school year i can not reach for my professor to ask him for help.
I know my question is vague but please help me to finish this project because it would help me a lot to find a job in the future.
I should also mention that i use a mysql-connector-java-5.1.38-bin.jar .If im not wrong this allows me to send data throw a TCP connection right? My main problem is that im missing the Full picture ,I know how to write basic code in java , i know how to build the xhtml pages and how to bind them to the java code behind but other than that i dont get how the rest of this works.
Any help is greatly appreciated.
Edit: as i said im bad at this. if you just post a generic link on "how to set up a Javaweb" i will not be able to follow . Im asking here ,on this forum because i want human answer. I need someone to post a 4-5 line explanation and like 8 bulletins on what to do like
*install linux
*Build and export your project.
*install glassfish standalone.
etc
The thinks google returns to me are like 400 pages of glassfish documentation and really hard to follow guides on how to do what i want. Of course i could waste the next month or so just reading and trying to figure out how everything comes together (witch i inevitably have to do)but i feel like im only 15 clicks away. I just want a practical answer.
You need an application server to "upload" the code. Use tomcat, its simple and has plenty of documentation available.
If you are using XAMPP, you may be familiar with Apache Server, which runs , among other things PHP. For Java, you need application server to run the server side code.
It doesnt matter which OS you want to use, Java runs on all. You just need to download and install tomcat for the OS you want to run it on.
Please refer to http://tomcat.apache.org/
I must point out that there are many more Application servers which are available. Tomcat is one of the most popular for learning purpose.

sipdroid - Another incoming call is not display while one is continue

I have installed SIPDROID. I made three account at sip2sip.
After that I have configured application using one of that account. Application works fine.
Question is: If I make multiple call to the same phone using SIP is there anyway to handle all calls at a same time?
Another incoming call is not displaying on mobile screen while first call is continue.
The first call getting picked up but what about the second call which is coming during first call.
Even second call is not displaying on the screen. Confused !!
Sipdroid that I what started with but after researching on it and from developers reviews I found that application has some missing functionality like multiple call and transferring calls etc...
I don't know but may who is expert in sip stack or have time to do can implement missing functionality but I am neither one of them so my desire to get an application that have all this functionality and by modifying it I can integrate into my application and csipsimple is the answer.
However its not easy job to build csipsimple into windows environment but there is hack how to do it. so carefully read its wiki about building project into window environment.
According to wiki you can build native library or you can go ahead without building the native library. I suggest for windows user to go with without building the native library.
If you have read wiki then in "without building the native library" section last line is like
"To get the .so files, download latest nightly build from nightly
build website and unpack the apk file (apk files are just zip files).
Then get lib/ARCH/.so files and copy it into CSipSimple
libs/ARCH/.so"
I have to clarify one important thing about that:
First get .apk file of csipsimple. The version of .apk file must same to download version of your csipsimple source code..
Here, you can see the source code version. Download the same version .apk and do further as described in wiki.
SipDroid supports only one line at all times. This means you cannot have conference calls. So to the question:
If I make multiple call to the same phone using SIP is there anyway to
handle all calls at a same time?
Nope, you cannot handle simultaneous calls at the same time. Fortunately there's another open source SIP Client that supports multiple lines - IMSDroid.
Though you can extend SipDroid to support multiple lines, that's a lot of effort. The main objects you have to pay attention to in order to support multiple lines are:
UserAgent, SipProvider (note that it's designed to support multiplexing/demultiplexing of SIP messages), JAudioLauncher and the Call object.
The bug you're describing with the second call not showing is not something I have witnessed. This could be due to your device setup, or due to customizations performed on the original code...
you can build the csipsimple easily in linux OS... All you have to do is just paste the download source link in linux commanpropmt and for windows you must have latest cygwin software to download or to build native library... Better option is to go for linux OS only...

updating JUST HTML files on Google App Engine

I have a Google App Engine Application, and as part of that Application I have my standard HTML pages, Home, ContactUs, Testimonials, Pricing ETC ETC, when users click on "login" or go to a specific URL eg (www.diarybooker.com/demo) it loads the actual application.
All these standard HTML files are fairly static files though, with analytics and SEO etc in them, however in order to update these currently I need to release a new version of my application every time.
Can anyone offer any advice as to how I can JUST update the HTML without having to release a new version of my application (especially if I am in the middle of a development cycle and don't want to branch just to update a contact number or fix an SEO issue etc)
It is entirely possible that I am actually using the system incorrectly and that I should be re-wiring things better/differently, but I cant find any information about how this SHOULD be setup, and Im not even sure what to search for either, so if anyone can at least point me in the direction of some information on this, I would be very greatful!!
By way of an alternative example, I have a friend who is running www.wineathome.org.uk and if you click on "attend a tasting" it moves off into http://wineathomeuk.appspot.com. Clearly this is not very clean and is also not the way to make it work, I could embed the application in an iframe, but is that really the way to go?!
You have your application code in source control, right? I'd suggest that you create a deployment directory and clone into it the version of the application that you want to have running on AppEngine. Then, copy into the deployment directory the versions of the HTML files that you want updated. Deploy away.
That is the only strategy that's going to work for you. The GAE deployment tool only deals with your application as a whole.
Looks like you have a couple of issues going on.
On the first issue as #AdamCrossland states you can use source control. I use git and create branches for my application at different versions. If you do that you can merge your updated HTML back into an older branch then update your application from that branch. That way your only changing the HTML files and leaving the application in it's current state. App Engine deploy is intelligent and will only upload the modified files. Doing this from Eclipse is a bit more difficult than from the CLI IMO, but YMMV.
The other issue of a friend clicking on attend a tasting routing the url to appspot is a bit harder to deal with unless some code is provided. I would think it is because the code is doing a redirect to a hard coded URL. I have several application mapped to a domains and none of them route to appspot unless I forced it to in order to use some functionality like HTTPS which only works on appspot.com. I personally try to avoid iframes it opens up an avenue for exploits.

Categories

Resources