Skip to content

Instantly share code, notes, and snippets.

View azec-pdx's full-sized avatar
👋
Always available ...

Amer Zec azec-pdx

👋
Always available ...
View GitHub Profile
@azec-pdx
azec-pdx / server.c
Created March 30, 2015 11:34
Socket vježba (primjer server-side koda)
/*
** server.c -- a stream socket server demo
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
@azec-pdx
azec-pdx / FB_event_photos.json
Created March 26, 2015 09:05
JSON Facebook Event Photos
{
"data": [
{
"created_time": "2015-03-17T19:06:25+0000",
"from": {
"id": "1390676681252253",
"name": "Christophe Joel Gouman"
},
"height": 346,
"icon": "https://fbstatic-a.akamaihd.net/rsrc.php/v2/yz/r/StEh3RhPvjk.gif",
@azec-pdx
azec-pdx / activity_main.xml
Created February 8, 2015 14:52
WakelockApplication primjer, layout
<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"
tools:context=".MainActivity" >
<Button
android:id="@+id/buttonStart"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@azec-pdx
azec-pdx / fragment_main.xml
Created January 30, 2015 16:13
Layout za RobolectricExample primjer
<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:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".MainActivity$PlaceholderFragment">
@azec-pdx
azec-pdx / onCreate.java
Created January 15, 2015 18:03
Gist za onCreate() u RESTWebService primjeru
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder()
.permitAll().build();
StrictMode.setThreadPolicy(policy);
setContentView(R.layout.activity_main);
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(
"http://www.cheesejedi.com/rest_services/get_big_cheese.php?puzzle=");
@azec-pdx
azec-pdx / activity_main.xml
Created January 13, 2015 23:25
Android layout za WebServiceTemperature
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="@+id/textView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
@azec-pdx
azec-pdx / gist:1a1b6ebaa958e7e80a65
Created January 13, 2015 18:27
Layout for WebService example
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="@+id/textView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
@azec-pdx
azec-pdx / gist:97791aa31c90aa32918a
Created December 23, 2014 19:46
Layout Handler primjer
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ProgressBar
android:id="@+id/progressBar1"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
@azec-pdx
azec-pdx / Glavni activity..
Created December 18, 2014 18:11
Glavni Activity za GPS primjer
package ba.edu.eksa.gpstest;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
public class GPSActivity extends Activity {
@azec-pdx
azec-pdx / getLocation
Created December 18, 2014 18:05
Dohvacanje lokacije GPS primjer
public Location getLocation() {
try {
locationManager = (LocationManager) mContext
.getSystemService(LOCATION_SERVICE);
// getting GPS status
isGPSEnabled = locationManager
.isProviderEnabled(LocationManager.GPS_PROVIDER);
// getting network status