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
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; |
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 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 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 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 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 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 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
// | |
// ViewController.swift | |
// FoodTracker | |
// | |
// Created by Jane Appleseed on 5/23/15. | |
// Copyright ? 2015 Apple Inc. All rights reserved. | |
// See LICENSE.txt for this sample’s licensing information. | |
// | |
import UIKit |
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
#include "logger.h" | |
int DebugLevel = DEBUG_WARN; | |
int main(void) | |
{ | |
DBGPRINT(DEBUG_WARN, ("hello,debug=%s\n", "aaa")); | |
return 0; | |
} |
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
#include <stdlib.h> | |
#include <stdio.h> | |
#include "list.h" | |
typedef struct episode { | |
int epid; | |
struct list_head list; | |
} episode_t; |
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
#import "UITableView+reloadDataAnimated.h" | |
@implementation UITableView (reloadDataAnimated) | |
- (void)reloadDataWithAnimated:(BOOL)animated | |
{ | |
[self reloadData]; | |
if (animated) { | |
CATransition *animation = [CATransition animation]; |
OlderNewer