REST request for service type. Provides method for finding, creating, modifiying service type.
-
POST
Create new service type
- acceptable request format: application/x-www-form-urlencoded
- acceptable request params:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:padding="4dp" | |
tools:context=".MainActivity"> | |
<WebView | |
android:id="@+id/webView" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" |
//Define URL | |
private static final String URL = "http://updatesepati.blogspot.com/"; | |
//Define WebView | |
private WebView webView; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
webView = (WebView)findViewById(R.id.webView); //get webView |
@Override | |
public boolean onKeyDown(int keyCode, KeyEvent event) { | |
if(keyCode == KeyEvent.KEYCODE_BACK && webView.canGoBack()) { | |
//back to previous url | |
webView.goBack(); | |
return true; | |
} | |
return super.onKeyDown(keyCode, event); | |
} |
<menu xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" tools:context=".MainActivity"> | |
<item android:id="@+id/action_exit" | |
android:title="@string/action_exit" | |
android:orderInCategory="100" | |
app:showAsAction="never" /> | |
</menu> |
@Override | |
public boolean onCreateOptionsMenu(Menu menu) { | |
getMenuInflater().inflate(R.menu.menu_main, menu); | |
return true; | |
} | |
@Override | |
public boolean onOptionsItemSelected(MenuItem item) { | |
int id = item.getItemId(); | |
if (id == R.id.action_exit) { |
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.webview" > | |
<uses-permission android:name="android.permission.INTERNET"/> | |
<application | |
android:allowBackup="true" | |
android:icon="@mipmap/ic_launcher" | |
android:label="@string/app_name" |
<?xml version="1.0" encoding="UTF-8" ?> | |
<!DOCTYPE html> | |
<html b:version='2' class='v2' expr:dir='data:blog.languageDirection' xmlns='http://www.w3.org/1999/xhtml' xmlns:b='http://www.google.com/2005/gml/b' xmlns:data='http://www.google.com/2005/gml/data' xmlns:expr='http://www.google.com/2005/gml/expr'> | |
<head> | |
<!--[if lt IE 9]> | |
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"> </script> | |
<![endif]--> | |
<meta content='width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1' name='viewport'/> | |
<meta content='text/html;charset=UTF-8' http-equiv='Content-Type'/> |
<?php | |
//Database Constant | |
define('DB_NAME', 'test'); //db name | |
define('DB_COLLECTION','friends'); //collection name | |
//Return Paramater Constant | |
define('INSERT_COL_SUCCESS', 0); | |
define('INSERT_COL_FAILED', 1); | |
define('REMOVE_FRIEND_SUCCESS', 0); | |
define('REMOVE_FRIEND_FAILED', 1); |
<?php | |
class dbConnect { | |
private $con; | |
private $db; | |
function __construct() {} | |
//connect to MongoDB function | |
function connect() { | |
include_once dirname(__FILE__) . '/config.php'; |