Indlæg

Viser indlæg fra august, 2013

Cisco UCS XML API Event from java

I've been working professionally on an integration with the Cisco UCS Manager. Their API is non-standard. It isn't SOAP or REST or any other well known protocol. But it seems that there are actually good reasons for this. It is easy to write scripts that uses the XML API.

I did not need to write scripts though. I had to implement a java client. There were limited resources available on the subject so I wanted to post what I came up with for subscribing for events.



    public void subscribe(String host, String port) throws InterruptedException, IOException, HttpException {
String subscribeRequest = "<eventSubscribe cookie=\"\"><inFilter></inFilter></eventSubscribe>";
        HttpClient httpclient = new DefaultHttpClient();

        try {
            HttpPost httpPost = new HttpPost(MessageFormat.format("http://{1}:{2}/nuova", host, port));

            httpPost.setEntity(new StringEntity(subscribeRequest));

            // Exe…

When the Android device appears offline while trying to debug

I struggled a bit with my Android device appearing offline while trying to deploy an app I was working on to my phone. I was trying running adb devices to figure out if the system could communicate with the phone.

./adb devices
List of devices attached
<serial_number> offline 
At least since version 4.2.2, there is a security question that appears on the phone requesting RSA verification with the computer. Be sure your tools are updated AND you allow the PC access by verifying the security question on the devices in question. This fixed it for me. And as always, verify you have debugging enabled in the developer options ;)

Using hardware devices for Android development on openSUSE

I started doing android development.

Debugging on my Galaxy Nexus on linux did not work out of the box like it does on OS X.

Google only documented the procedure for Ubuntu based system.

On openSUSE you can put the udev rule here:
/usr/lib/udev/rules.d/51-android.rules

For a Galaxy Nexus you would add the line:
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666", GROUP="users"

For other devices change "04e8" to the relevant USB vendor id

Edit (2nd January 2014): Most devices are now automatically included in the above mentioned file. (Running openSUSE 12.3)