Debug log:

 
                                

Android development

Android phones can do great things. How can we make them easier to code? This one is for the crazy ones, for the misfits and trouble makers. Enjoy.

 

Building the app

To build the app, fastaphi needs help from Java and Android SDK. But no need for android studio. And the java-platform could be cloud based. Just as Arduino for the AVR, simplifying the Android development could mean a lot for inventing new areas for smart devices. It's just a stub, but it's working. Compiling in less than 10 seconds. ;)

 

<content type="android/app" apkName="myApk" package="com.testing.one" \
    target="C:/Users/tjelvar/Android/theappX">
    <app name="Apps is Easy" icon="newton">
        <activity name="splash" launcher="yes">
            <toast func="onCreate" message="starting" /> 
            <table>
                <tr>
                    <edittext id="tx1" value="Start-value" width="30%"/>
                    <button id="button1" label="Go measure!" goact="main" width="40%"/>
                </tr>
            </table>
            <relative valign="bottom"> 
                <cols width="parent">
                    <button id="button2" label="Try me!!" onclick="changeLabel" width="100%"/>
                </cols>
            </relative>
            <raw type="java">
            public void changeLabel(View view) { 
                //i rock
                Button myButton = (Button) findViewById(R.id.button2);
                myButton.setText("updating..");
                EditText myText = (EditText) findViewById(R.id.tx1);
                myText.setText("great!");
            }
            </raw>                
        </activity>
        <activity name="main">
            <sensor type="accelerometer" speed="normal" name="myAcc" function="gravity"/>
            <raw type="java">
            public void gravity(SensorEvent sensorEvent) {
                float x = sensorEvent.values[0];
                EditText myText = (EditText) findViewById(R.id.tx5);
                myText.setText(Float.toString(x));
            }

            public void showLux(SensorEvent sensorEvent) {
                float x = sensorEvent.values[0];
                EditText myText = (EditText) findViewById(R.id.tx6);
                myText.setText(Float.toString(x));
            }
            </raw>
            <sensor type="light" speed="normal" name="myLux" function="showLux"/>
            <table>
                <tr>
                    <textview id="lb2" value="Angle:" width="40%"/>
                    <edittext id="tx5" value="G" width="60%"/>
                    <sound name="mySound" file="sleep" autoplay="yes"/>
                </tr>
                <tr>
                    <textview id="lb3" value="Lux:" width="40%"/>
                     <edittext id="tx6" value="L" width="60%"/>
                </tr>
            </table>
        </activity>
    </app>
</content>