Skip to content

Instantly share code, notes, and snippets.

View ShakibHabibi's full-sized avatar

shakib habibi ShakibHabibi

View GitHub Profile
package com.shkbhbb.performancetest;
import android.app.Application;
public class MyApp extends Application {
public static String ID = "";
@Override
public void onCreate() {
#include <stdio.h>
int main( int argc, char *argv[] ) {
if( argc == 2 ) {
printf("The argument supplied is %s\n", argv[1]);
}
else if( argc > 2 ) {
printf("Too many arguments supplied.\n");
}
public List<PrivateMessage> getChatMessages(int chatId) {
List<PrivateMessage> privateMessages = new ArrayList<>();
SQLiteDatabase db = dbHelper.getReadableDatabase();
String query = SELECT_ALL + CHAT_MESSAGES_TABLE_NAME
+ WHERE + CHAT_MESSAGES_COLUMN_CHAT_ID + EQUAL + chatId + ORDER_BY
+ CHAT_MESSAGES_COLUMN_MESSAGE_ID + ASC;
Cursor cursor = db.rawQuery(query, null);
cursor.moveToFirst();