Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .idea/.name

This file was deleted.

3 changes: 0 additions & 3 deletions .idea/copyright/profiles_settings.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/encodings.xml

This file was deleted.

11 changes: 3 additions & 8 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 1 addition & 17 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "24.0.1"
buildToolsVersion "25.0.0"

defaultConfig {
applicationId "org.istsos.androiddemo"
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
<activity android:name=".DisplayInsertObservation" />
android:theme="@style/CustomTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".DisplayInsertObservation" />
<activity android:name=".AboutIstSos" />
<activity android:name=".ObservationActivities" />
<activity android:name=".DescribeSensorActivity" />
<activity android:name=".GetObservationActivity" />
Expand Down
58 changes: 58 additions & 0 deletions app/src/main/java/org/istsos/androiddemo/AboutIstSos.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package org.istsos.androiddemo;

import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

/**
* Created by rahul on 10/3/17.
*/

public class AboutIstSos extends AppCompatActivity {
TextView AboutTV;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.about_istsos);
getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.parseColor("#252535")));
getSupportActionBar().setDisplayShowCustomEnabled(true);
getSupportActionBar().setCustomView(R.layout.custom_layout_actionbar);
View view=getSupportActionBar().getCustomView();
AboutTV= (TextView) view.findViewById(R.id.about_tv);
AboutTV.setText("Server-> About");
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.action_settings:
Toast.makeText(this, "selected Server", Toast.LENGTH_SHORT).show();
return true;
case R.id.service_settings:
Toast.makeText(this, "selected Services", Toast.LENGTH_SHORT).show();
return true;
case R.id.data_manage_settings:
Toast.makeText(this, "selected Data Management", Toast.LENGTH_SHORT).show();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,46 +1,52 @@
package org.istsos.androiddemo;

import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;

public class DescribeSensorActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_describe_sensor);
getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.parseColor("#252535")));
getSupportActionBar().setDisplayShowCustomEnabled(true);
getSupportActionBar().setCustomView(R.layout.custom_layout_actionbar);
View view=getSupportActionBar().getCustomView();
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.add(R.id.container, new DescribeSensorFragment())
.commit();
}

Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();

//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}

return super.onOptionsItemSelected(item);
}
// @Override
// public boolean onCreateOptionsMenu(Menu menu) {
// // Inflate the menu; this adds items to the action bar if it is present.
// getMenuInflater().inflate(R.menu.menu_main, menu);
// return true;
// }
//
// @Override
// public boolean onOptionsItemSelected(MenuItem item) {
// // Handle action bar item clicks here. The action bar will
// // automatically handle clicks on the Home/Up button, so long
// // as you specify a parent activity in AndroidManifest.xml.
// int id = item.getItemId();
//
// //noinspection SimplifiableIfStatement
// if (id == R.id.action_settings) {
// return true;
// }
//
// return super.onOptionsItemSelected(item);
// }
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;

import org.istsos.client.EventObject;
import org.istsos.client.IstSOS;
Expand Down Expand Up @@ -41,29 +42,28 @@ public void onCreate(Bundle savedInstanceState) {
setHasOptionsMenu(true);
}

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
inflater.inflate(R.menu.menu_main, menu);
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();

//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}

return super.onOptionsItemSelected(item);
}
// @Override
// public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
// inflater.inflate(R.menu.menu_main, menu);
// }
//
// @Override
// public boolean onOptionsItemSelected(MenuItem item) {
// // Handle action bar item clicks here. The action bar will
// // automatically handle clicks on the Home/Up button, so long
// // as you specify a parent activity in AndroidManifest.xml.
// int id = item.getItemId();
//
// //noinspection SimplifiableIfStatement
// if (id == R.id.action_settings) {
// return true;
// }
//
// return super.onOptionsItemSelected(item);
// }

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
// Inflate the layout for this fragment
View rootView = inflater.inflate(R.layout.fragment_describe_sensor, container, false);
//retrieve intent from main activity
Expand Down Expand Up @@ -101,20 +101,17 @@ protected void loadDescribeSensor(){

final Service service = server.getService(serviceName);

service.describeSensor("T_LUGANO", new IstSOSListener() {
service.describeSensor("BELLINZONA", new IstSOSListener() {

@Override
public void onSuccess(EventObject event) {

describedSensor = (Procedure) event.getObject();

name = describedSensor.getName();
description = describedSensor.getDescription();
keywords = describedSensor.getKeywords();
assignedId = describedSensor.getAssignedId();

System.out.println(name);
}

@Override
public void onError(EventObject event) {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
package org.istsos.androiddemo;

import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.hardware.Sensor;
import android.hardware.SensorManager;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;

import org.istsos.client.EventObject;
import org.istsos.client.IstSOS;
Expand All @@ -20,11 +24,18 @@ public class DisplayInsertObservation extends AppCompatActivity{

private SensorManager mSensorManager;
private Sensor mTemperature;

TextView AboutTV;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_display_insert_observation);
getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.parseColor("#252535")));
getSupportActionBar().setDisplayShowCustomEnabled(true);
getSupportActionBar().setCustomView(R.layout.custom_layout_actionbar);
View view=getSupportActionBar().getCustomView();
AboutTV= (TextView) view.findViewById(R.id.about_tv);
AboutTV.setText("Insert Observation");
}

public void insertObservation(View view){
Expand All @@ -41,9 +52,9 @@ public void onSuccess(EventObject event) {
mSensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
mTemperature = mSensorManager.getDefaultSensor(Sensor.TYPE_AMBIENT_TEMPERATURE);

//service.describeSensor("");
service.describeSensor("");

//service.insertObservation();
//service.insertObservation("");


}
Expand Down
Loading