The title is a little confusing as I do not know what is the appropriate way to name it. I just started to learn widget programming and roughly got the idea how to make a simple widget. Now I want to use it on my actual application which does a few things:
- Uses an IP Address to ping web servers (to check activeness of each server)
- Web servers requires certificate authentication
The actual application is already working with no problems, I just wish to do a widget for 1 of the servers I am pinging to. I used a custom DefaultHttpClient, MyHttpClient class, which does all my certificate authentications. How I use this, MyHttpClient class is by typing
DefaultHttpClient client = new MyHttpClient(getApplicationContext());
And it only works if I have it within an Activity class. It does not work within the AppWidgetProvider class. The error it gives is :
The method getApplicationContext() is undefined for the type SystemWidget.ParseLoyalty SystemWidget.java