Merge pull request #628 from charithag/master

UI/UX Improvements
revert-dabc3590
Amal Gunatilake 8 years ago committed by GitHub
commit 4fec9a2db6

@ -20,7 +20,7 @@ hw.sdCard=no
hw.sensors.orientation=yes
hw.sensors.proximity=yes
hw.trackBall=no
image.sysdir.1=system-images/android-24/default/x86/
image.sysdir.1=system-images/android-23/default/x86/
skin.dynamic=no
skin.name=720x1280
skin.path=720x1280

@ -56,48 +56,48 @@ getAndroidSDK() {
}
createAVD() {
if [ ! -d "$ANDROID_TRYIT_SDK_HOME/platforms/android-24" ]; then
if [ ! -d "$ANDROID_TRYIT_SDK_HOME/platforms/android-23" ]; then
echo
echo "Downloading Android platform..."
cd $ANDROID_TRYIT_SDK_HOME
downloadArtifacts "https://dl.google.com/android/repository/platform-24_r02.zip"
downloadArtifacts "https://dl.google.com/android/repository/platform-23_r03.zip"
echo -n "Configuring Android platform..."
unzip -q platform-24_r02.zip
mkdir -p platforms/android-24
mv android-7.0/* platforms/android-24/
rm -r android-7.0
rm platform-24_r02.zip
unzip -q platform-23_r03.zip
mkdir -p platforms/android-23
mv android-6.0/* platforms/android-23/
rm -r android-6.0
rm platform-23_r03.zip
cd ..
echo " Done!"
fi
if [ ! -d "$ANDROID_TRYIT_SDK_HOME/system-images/android-24/default" ]; then
if [ ! -d "$ANDROID_TRYIT_SDK_HOME/system-images/android-23/default" ]; then
echo "Downloading Android system image..."
cd $ANDROID_TRYIT_SDK_HOME
downloadArtifacts "https://dl.google.com/android/repository/sys-img/android/x86-24_r07.zip"
downloadArtifacts "https://dl.google.com/android/repository/sys-img/android/x86-23_r09.zip"
echo -n "Configuring Android system image..."
unzip -q x86-24_r07.zip
mkdir -p system-images/android-24/default
mv x86 system-images/android-24/default
rm x86-24_r07.zip
unzip -q x86-23_r09.zip
mkdir -p system-images/android-23/default
mv x86 system-images/android-23/default
rm x86-23_r09.zip
cd ..
echo " Done!"
fi
echo "Creating a new AVD device"
if [ -f "$ANDROID_TRYIT_SDK_HOME/tools/bin/avdmanager" ]; then
$ANDROID_TRYIT_SDK_HOME/tools/bin/avdmanager create avd -k 'system-images;android-24;default;x86' -n WSO2_AVD
$ANDROID_TRYIT_SDK_HOME/tools/bin/avdmanager create avd -k 'system-images;android-23;default;x86' -n WSO2_AVD
else
$ANDROID_TRYIT_SDK_HOME/tools/android create avd -n WSO2_AVD -t android-24
$ANDROID_TRYIT_SDK_HOME/tools/android create avd -n WSO2_AVD -t android-23
fi
rm $HOME/.android/avd/WSO2_AVD.avd/resources/config.ini
rm $HOME/.android/avd/WSO2_AVD.avd/config.ini
cp $SCRIPT_HOME/resources/config.ini $HOME/.android/avd/WSO2_AVD.avd/
startAVD
}
startAVD() {
if [ ! -d "$HOME/.android/avd/WSO2_AVD.avd" ]; then
echo -n "Seems you don't have WSO2_AVD. Do you want to create WSO2_AVD with default configs (y/N)?: "
echo -n "Looks you don't have the WSO2_AVD. Do you want to create WSO2_AVD with default configs (Y/n)?: "
read answer
if echo "$answer" | grep -iq "^y" ;then
if ! echo "$answer" | grep -iq "^n" ;then
createAVD
return
fi
@ -178,12 +178,12 @@ echo "| WSO2 Android Tryit |"
echo "+----------------------------------------------------------------+"
echo "Detected OS: " $OSTYPE
if [ ! -f "sdklocation" ]; then
echo -n "Do you have Android SDK installed in your computer (Y/n)?: "
echo -n "Do you have an Android SDK installed on your computer (y/N)?: "
read answer
if echo "$answer" | grep -iq "^n" ;then
getAndroidSDK
else
if echo "$answer" | grep -iq "^y" ;then
setSDKPath
else
getAndroidSDK
fi
fi
export ANDROID_TRYIT_SDK_HOME=$(<sdklocation)

@ -378,7 +378,7 @@ $(document).ready(function () {
// on error
function () {
var content = "<li class='message message-danger'><h4><i class='icon fw fw-error'></i>Warning</h4>" +
"<p>Unexpected error occurred while loading notification. Please refresh the page and" +
"<p>Unexpected error occurred while loading notification. Please refresh the pa{{#if isCloud}}ge and" +
" try again</p></li>";
$(messageSideBar).html(content);
}

@ -25,13 +25,24 @@
class="btn-operations remove-margin download_agent">
<i class="fw fw-download fw-inverse fw-lg add-margin-1x"></i> Download Try-it Emulator</a></div>
{{else}}
<h3 class="text-center">Scan to download the Android Agent.</h3>
<h3 class="text-center">Scan to get the Android Agent.</h3>
<div class="enrollment-qr-container text-center"></div>
<h3 class="text-center add-margin-bottom-2x add-margin-top-2x">or</h3>
<div class="text-center"><a
href="{{host}}/android-web-agent/public/mdm.page.enrollments.android.download-agent/asset/android-agent.apk"
{{#if isCloud}}
<div class="text-center">
<a href='https://play.google.com/store/apps/details?id=org.wso2.iot.agent&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'
target="_blank">
<img alt='Get it on Google Play'
src='{{@unit.publicUri}}/images/en_badge_web_generic_export.png'/>
</a>
</div>
{{else}}
<div class="text-center">
<a href="{{host}}/android-web-agent/public/mdm.page.enrollments.android.download-agent/asset/android-agent.apk"
class="btn-operations remove-margin download_agent">
<i class="fw fw-download fw-inverse fw-lg add-margin-1x"></i> Download APK</a></div>
<i class="fw fw-download fw-inverse fw-lg add-margin-1x"></i> Download APK</a>
</div>
{{/if}}
{{/if}}
</div>
<!--<p class="doc-link">Please scan the QR code to download the APK on to your android device or click
@ -63,41 +74,84 @@
{{#if isCloud}}
<div class="row grey-bg">
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4 col-md-offset-1 col-lg-offset-1 add-padding-top-2x add-padding-bottom-2x">
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 col-md-offset-1 col-lg-offset-1 add-padding-top-2x add-padding-bottom-2x">
<h5><strong>Step 1</strong></h5>
{{#if isVirtual}}
<ol>
<li>Unzip the 'android-tryit.zip and run 'start' script in your terminal.</li>
<li>If you already have android sdk in your computer, please provide location of the sdk.
Otherwise this tool will download and install minimum SDK components which needs to run the emulator.
This is a one time process.</li>
<li>This tool will ask to create AVD if you don't have any in your computer.
Otherwise you can select existing AVD to try out IoT Agent.</li>
</ol>
<img src="{{@unit.publicUri}}/images/android-tryit.png" class="img-responsive">
{{else}}
<p>Let's start by installing the Android agent on your device. Open the downloaded file, and tap
<b>INSTALL</b>.</p>
<img src="{{@unit.publicUri}}/images/install_agent.png" class="img-responsive">
{{/if}}
{{#if isVirtual}}
<div class="add-min-height">
<ol>
<li>Unzip the 'android-tryit.zip file and run the 'start' script on your terminal.</li>
<li>Download and install the Android SDK.
<ul>
<li>If you already have an Android SDK on your computer, please provide the location of the SDK.</li>
<li>Else, this tool will download and install the minimum SDK components required to run the emulator.
This is a one-time process.</li>
</ul>
</li>
<li>Next, you will be asked to create an AVD:
<ul>
<li>If you don't have one, the WSO2_AVD will be created for you.</li>
<li>Else, you can use an existing AVD to try out IoT Android agent.</li>
</ul>
</li>
</ol>
</div>
<img src="{{@unit.publicUri}}/images/android-tryit.png" class="img-responsive">
{{else}}
<div class="add-min-height">
<p>Let's start by opening the Android agent on your device.
<br/>Tap on <b>WSO2 Device Management Agent</b>.
</p>
</div>
<img src="{{@unit.publicUri}}/images/launch_agent.png" class="img-responsive">
{{/if}}
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4 col-md-offset-2 col-lg-offset-2 add-padding-top-2x add-padding-bottom-2x">
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 col-md-offset-1 col-lg-offset-1 add-padding-top-2x add-padding-bottom-2x">
<h5><strong>Step 2</strong></h5>
<p>Enter your:<p>
<ul>
<li>Organization: <b>{{@user.domain}}</b></li>
<li>Username: <b>{{@user.username}}</b></li>
<li>Password: <i>The WSO2 Cloud password.</i></li>
</ul>
<img src="{{@unit.publicUri}}/images/login.png" class="img-responsive">
<div class="add-min-height">
<p>Enter your:
<p>
<ul>
<li>Organization: <b>{{@user.domain}}</b></li>
<li>Username: <b>{{@user.username}}</b></li>
<li>Password: <i>The WSO2 Cloud password.</i></li>
</ul>
</div>
<img src="{{@unit.publicUri}}/images/register.png" class="img-responsive">
</div>
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 col-md-offset-1 col-lg-offset-1 add-padding-top-2x add-padding-bottom-2x">
<h5><strong>Step 3</strong></h5>
<div class="add-min-height">
<p>When prompt, allow necessary permissions and activate device admin.</p>
</div>
<img src="{{@unit.publicUri}}/images/activate_deviceadmin.png" class="img-responsive">
</div>
{{else}}
<div class="row grey-bg">
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 add-padding-top-2x add-padding-bottom-2x">
<h5><strong>Step 1</strong></h5>
<p>Let's start by installing the Android agent on your device. Open the downloaded file, and tap
<b>INSTALL</b>.</p>
<img src="{{@unit.publicUri}}/images/install_agent.png" class="img-responsive">
{{#if isVirtual}}
<ol>
<li>Unzip the 'android-tryit.zip file and run the 'start' script on your terminal.</li>
<li>Download and install the Android SDK.
<ul>
<li>If you already have an Android SDK on your computer, please provide the location of the SDK.</li>
<li>Else, this tool will download and install the minimum SDK components required to run the emulator.
This is a one-time process.</li>
</ul>
</li>
<li>Next, you will be asked to create an AVD:
<ul>
<li>If you don't have one, the WSO2_AVD will be created for you.</li>
<li>Else, you can use an existing AVD to try out IoT Android agent.</li>
</ul>
</li>
</ol>
<img src="{{@unit.publicUri}}/images/android-tryit.png" class="img-responsive">
{{else}}
<p>Let's start by installing the Android agent on your device. Open the downloaded file, and tap
<b>INSTALL</b>.</p>
<img src="{{@unit.publicUri}}/images/install_agent.png" class="img-responsive">
{{/if}}
</div>
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 add-padding-top-2x add-padding-bottom-2x">
@ -115,11 +169,11 @@
<p>Enter your:
<p>
<ul>
<li>Username: username/email that you used to sign in to IoT server.</li>
<li>Password: the WSO2 Iot server password.</li>
<li>Domain: the name of the domain.</li>
<li>Organization: <b>{{@user.domain}}</b></li>
<li>Username: <b>{{@user.username}}</b></li>
<li>Password: <i>The WSO2 Cloud password.</i></li>
</ul>
<img src="{{@unit.publicUri}}/images/install_agent.png" class="img-responsive">
<img src="{{@unit.publicUri}}/images/register.png" class="img-responsive">
</div>
{{/if}}

@ -16,27 +16,32 @@
* under the License.
*/
function onRequest(context){
function onRequest(context) {
var viewModel = {};
var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
//uncomment this to enable analytics artifact deployment
//var serviceInvokers = require("/app/modules/oauth/token-protected-service-invokers.js")["invokers"];
//var url = devicemgtProps["httpsURL"] + "/api/device-mgt/v1.0/admin/devicetype/deploy/android/status";
//serviceInvokers.XMLHttp.get(
// url, function (responsePayload) {
// var responseContent = responsePayload.status;
// new Log().error(responseContent);
// if ("204" == responsePayload.status) {
// viewModel["displayStatus"] = "Display";
// }
// },
// function (responsePayload) {
// //do nothing.
// }
//);
//uncomment this to enable analytics artifact deployment
//var serviceInvokers = require("/app/modules/oauth/token-protected-service-invokers.js")["invokers"];
//var url = devicemgtProps["httpsURL"] + "/api/device-mgt/v1.0/admin/devicetype/deploy/android/status";
//serviceInvokers.XMLHttp.get(
// url, function (responsePayload) {
// var responseContent = responsePayload.status;
// new Log().error(responseContent);
// if ("204" == responsePayload.status) {
// viewModel["displayStatus"] = "Display";
// }
// },
// function (responsePayload) {
// //do nothing.
// }
//);
var isCloud = devicemgtProps["isCloud"];
viewModel["isVirtual"] = request.getParameter("type") == 'virtual';
viewModel["isCloud"] = devicemgtProps["isCloud"];
viewModel["isCloud"] = isCloud;
viewModel["hostName"] = devicemgtProps["httpsURL"];
viewModel["enrollmentURL"] = devicemgtProps["generalConfig"]["host"] + devicemgtProps["androidEnrollmentDir"];
if (isCloud) {
viewModel["enrollmentURL"] = "https://play.google.com/store/apps/details?id=org.wso2.iot.agent";
} else {
viewModel["enrollmentURL"] = devicemgtProps["generalConfig"]["host"] + devicemgtProps["androidEnrollmentDir"];
}
return viewModel;
}
Loading…
Cancel
Save