I want to add a "Tweet" button to a C++ application without use of heavy libraries and frameworks. The application is portable and runs on Android and Windows.
1 Answers
I am not sure if I understand your setup. If you have implemented a native part of an Android app you can still write some java UI code and call your c++ code from there. If you want to have a full portable solution though I would render simple button with help of OpenGL.
UPDATE Oh I see what you meant, so this is actually quite simple. For Android many people use Twitter4j which is not that "heavy". You can also implement API calls on your own, see the official docs. Besides, there are a couple of more possibilities on SO with links to some tutorials.
As for portability, it gets a bit trickier. I would stick with twitter API and implement HTTP calls directly. The quickest way to get it done in a portable way is to write a thin wrapper around the socket calls as someone here suggested.
You could also use Boost.Asio or cURL library, but I have not checked them personally. The latter is available for windows and has recently been ported to Android.
Hope that helps!
-
1This is not about rendering, this is all about making action after the button is pressed: how to submit something to twitter. – Sergey K. Feb 01 '12 at 05:26
-
1Ok, thats good for Java, but how about portability? I want my button to work in Windows and stick to C++ there. – Sergey K. Feb 01 '12 at 07:51