This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Copyright 2013 Ognyan Bankov | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static String getSearchResult(String search) { | |
StringBuilder buf = new StringBuilder(); | |
String searchQuery = "SELECT * FROM data_structure WHERE element_name LIKE '%" + search + "%'"; | |
// String searchQuery = "SELECT * FROM data_structure WHERE data_structure_type LIKE '%" + search + "%' or element_name LIKE '%" + search + "%' or element_description LIKE '%" + search + "%' or rational LIKE '%" + search + "%' or field_namecode LIKE '%" + search + "%' or alias LIKE '%" + search + "%' or field_size LIKE '%" + search + "%' or element_owner LIKE '%" + search + "%'"; | |
try { | |
currentCon = ConnectionManager.getConnection(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class DbHandler { | |
private $conn; | |
function __construct() { | |
require_once dirname(__FILE__) . '/DbConnect.php'; | |
// opening db connection | |
$db = new DbConnect(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<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" > | |
<Button | |
android:id="@+id/firstview" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
protected void onPostExecute(String json) { | |
try { | |
categories = new JSONArray(json); | |
if (categories != null) { | |
// looping through All albums | |
for (int i = 0; i < categories.length(); i++) { | |
JSONObject c = categories.getJSONObject(i); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CategoryListAdapter extends BaseAdapter { | |
// class constructor | |
public CategoryListAdapter(Context context, | |
ArrayList<HashMap<String, String>> items) { | |
} | |
// How many items are in the data set represented by this Adapter. | |
public int getCount() { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected void onCreate(Bundle savedInstanceState) { | |
... | |
// get listview | |
ListView lv = getListView(); | |
lv.setDivider(null); | |
lv.setOnItemClickListener(new android.widget.AdapterView.OnItemClickListener() { | |
@Override | |
public void onItemClick(AdapterView<?> arg0, View view, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="wrap_content" | |
android:layout_height="match_parent" > | |
<ListView | |
android:id="@android:id/list" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="fill_parent" | |
android:layout_height="wrap_content" | |
android:orientation="vertical" | |
android:padding="10dp" > | |
<TextView | |
android:id="@+id/category_id" | |
android:layout_width="fill_parent" | |
android:layout_height="wrap_content" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CategoryActivity extends ListActivity { | |
ArrayList<HashMap<String, String>> categoryList; | |
... | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
... | |
categoryList = new ArrayList<HashMap<String, String>>(); | |
... |
OlderNewer