Skip to content

Instantly share code, notes, and snippets.

View sunmeat's full-sized avatar
🐈
MEOW

Oleksandr Zahoruiko sunmeat

🐈
MEOW
View GitHub Profile
@sunmeat
sunmeat / different files
Last active January 29, 2024 17:56
alarm android example
AndroidManifest.xml:
...
<uses-permission android:name="com.android.alarm.permission.SET_ALARM" />
...
==============================================================================================
MainActivity.java:
@sunmeat
sunmeat / different files
Created January 29, 2024 17:13
android calendar example
MainActivity.java:
package com.sunmeat.calendar;
import android.Manifest;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
import android.content.pm.PackageManager;
import android.os.Build;
@sunmeat
sunmeat / different files
Created January 29, 2024 16:59
send sms android example
MainActivity.java:
package com.sunmeat.services;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.telephony.SmsManager;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
@sunmeat
sunmeat / different files
Last active February 26, 2024 07:41
action call example android
AndroidManifest.xml:
...
<uses-feature
android:name="android.hardware.telephony"
android:required="false" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
...
@sunmeat
sunmeat / ProductQueries2.sql
Created January 15, 2024 14:23 — forked from SlavikArt/ProductQueries2.sql
Product SQL Queries 2
-- 3. Показать названия и цены товаров,
-- доставленных на протяжении последнего месяца.
SELECT name, price
FROM Product
WHERE date_of_delivery >= DATEADD(MONTH, -1, GETDATE())
-- 4. Показать на экран названия и цены товаров
-- с категорией "Кондитерские изделия", но только не торговой марки "Roshen"
SELECT name, price
FROM Product
@sunmeat
sunmeat / different files
Last active February 12, 2024 07:14
main menu android example
res \ values \ strings.xml:
<resources>
<string name="app_name">Menu Example</string>
<string name="file">File</string>
<string name="edit">Edit</string>
<string name="view">View</string>
<string name="navigate">Navigate</string>
</resources>
@sunmeat
sunmeat / different files
Last active February 9, 2024 07:47
listview android example 2
layout\my_item.xml:
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="casual"
android:padding="10dp"
android:textColor="@color/pink"
android:textSize="30sp"
android:textStyle="bold" />
@sunmeat
sunmeat / different files
Last active February 9, 2024 07:34
listview android example 1
AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application
...
android:theme="@style/Theme.AppCompat.DayNight.DarkActionBar"
...
@sunmeat
sunmeat / different files
Created January 9, 2024 12:09
floating action button m3 example
activity_main.xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
@sunmeat
sunmeat / MainActivity.java
Created January 8, 2024 12:49
logs + save state
package com.sunmeat.myapplication;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
public class MainActivity extends AppCompatActivity {