cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

Android Smartphones and Thingworx tutorial

aagarwal-21
1-Visitor

Android Smartphones and Thingworx tutorial

I am having issues running the Android tutorial outlined in Android Smartphones and Thingworx - ThingWorx : ThingWorx. Can someone please confirm that it works in Composer 7.1.1

ACCEPTED SOLUTION

Accepted Solutions

Anurag,

A quick test, try going to the PlatformSubsystem Subsystem, click on the Configuration menu option, locate the "Allow Request Method Switch" option and check that, and then uncheck the "Filter Content Type" option.

Try running your request again and see if the property value changes.

Meghan

View solution in original post

5 REPLIES 5
Aanjan
12-Amethyst
(To:aagarwal-21)

Anurag, please do post some information on where you're running issues into. Is it the connectivity side or is it something on the platform?

Hello Ravi,

I am using the 120 day trial server and have gone through all the steps as per the tutorial. I do not see any data reflected in the mashup for the specific Thing. The url being used in the android app to update the properties is shown below -

URL url = new URL("http://" + ipAddress

                + "/Thingworx"

                + "/Things/AndroidDevice_" + thing

                + "/Properties/" + property

                + "?method=put"

                + "&value=" + value

                + "&appKey=" + appKey);

Is this correct?

Aanjan
12-Amethyst
(To:aagarwal-21)

When you run the REST call, do you see any error message(s) on the Platform's Application log?

Hi,

URL -

http://<IP>/Thingworx/Things/AndroidDevice_354994059405056/Properties/cpuUsage?method=put&value=75&appKey=<App Key>

The response is -

<HTML><HEAD><TITLE>Property Value For AndroidDevice_354994059405056 &#x3a; cpuUsage</TITLE><LINK rel='Stylesheet' href='/Thingworx/css/thingworxapi.css' type='text/css'></LINK><META http-equiv='Content-Type' content='text/html'></META><META http-equiv='cache-control' content='no-cache, no-store'></META><META http-equiv='expires' content='-1'></META><META http-equiv='pragma' content='no-cache, no-store'></META><script type="text/javascript" src="http://gc.kis.scr.kaspersky-labs.com/42C8AA17-0B2E-684A-844D-ACE027904012/main.js" charset="UTF-8"></script></HEAD><BODY><IMG SRC="/Thingworx/images/ThingworxLogo.png"/><BR/><H1>Property Value For AndroidDevice_354994059405056 &#x3a; cpuUsage</H1><TABLE><TR><TH>cpuUsage</TH></TR><TR><TD></TD></TR></TABLE></BODY></HTML>

As you can see, no value us returned for cpuUsage, indicating that it is not updated.

Thanks

Anurag

Anurag,

A quick test, try going to the PlatformSubsystem Subsystem, click on the Configuration menu option, locate the "Allow Request Method Switch" option and check that, and then uncheck the "Filter Content Type" option.

Try running your request again and see if the property value changes.

Meghan

Announcements


Top Tags