This file contains hidden or 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
CC=gcc | |
CFLAGS=-Wall -IDIR | |
LDFLAGS=-LDIR -lfoo | |
TARGET= a.out | |
#SOURCES=bar.c | |
SOURCES=$(wildcard *.c) | |
OBJECTS=$(SOURCES:.c=.o) |
This file contains hidden or 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
#include <stdio.h> | |
#include <string.h> | |
#include <json/json.h> | |
#include <curl/curl.h> | |
/* | |
* to install lib: | |
* apt-cache search ^libcurl | |
* apt-get install <whatever_apt-cache_listed> |
This file contains hidden or 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
//from https://github.com/vecio/MediaCodecDemo | |
package io.vec.demo.mediacodec; | |
import java.nio.ByteBuffer; | |
import android.app.Activity; | |
import android.media.MediaCodec; | |
import android.media.MediaCodec.BufferInfo; |
This file contains hidden or 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
//fix | |
import android.os.Process; | |
HandlerThread thread = new HandlerThread("work thread", Process.THREAD_PRIORITY_BACKGROUND); |
This file contains hidden or 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 MainActivity extends Activity { | |
//... | |
public void CheckService(View v) { | |
boolean isRunning = isMyServiceRunning(myService.class); | |
Log.d(TAG, "my service running status: " + isRunning); | |
} | |
private boolean isMyServiceRunning(Class<?> serviceClass) { | |
ActivityManager manager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); |
This file contains hidden or 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
import android.app.Activity; | |
import android.app.Service; | |
import android.content.BroadcastReceiver; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.content.IntentFilter; | |
import android.os.Bundle; | |
import android.os.IBinder; | |
import android.support.v4.content.LocalBroadcastManager; |
NewerOlder