Cara mengambil gambar / video dari story whatsapp orang lain tanpa aplikasi/software tambahan

Berikut saya bagikan cara untuk mengambil status WhatsApp orang lain tanpa menggunakan aplikasi atau software tambahan :

  1. Pastikan status whatsapp orang lain(foto/video) yang ingin anda ambil sudah anda view/lihat.
  2. Buka file manager pada android, pilih penyimpanan perangkat / penyimpanan internal.
  3. pada bagian option pilih tampilkan file tersembunyi
  4. Untuk android versi lawas cari folder WhatsApp / Media / .Statuses di sana terdapat file(foto/video) yang telah anda lihat di status Whatsapp anda.
    Untuk android versi terbaru cari folder android-media-com(dot)whatsapp-whatsapp-media kemudia pilih whatsapp images / whatsapp video
  5. Kemudian cari foto / video yang ingin anda ambil. Pilih file tersebut dan copy ke galery / folder yang anda inginkan.
  6. Buka galley anda dan file tersebut akan muncul di daftar file gallery anda.

Selamat mencoba 🙂

Kotlin setOnLongClickListener error type mismatch

Saya mendapat warning error “Type mismatch Required:Boolean Found:Unit” pada method onLongClickListener pada potongan kode dibawah

holder.binding!!.labelNorek.setOnLongClickListener {
    val clipboardManager: ClipboardManager = activity.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
    val clip: ClipData = ClipData.newPlainText("label", holder.binding!!.labelNorek.getText())
    clipboardManager.setPrimaryClip(clip)
    Toast.makeText(activity, "Text disalin", Toast.LENGTH_SHORT).show()
}

Penyebab : Berdasarkan solusi yang saya dapat di sini OnLongClickListener.onLongClick signature required that you return a boolean to notify if you actually consumed the event

Solusi : return true pada block penutup method onLongClickListener

holder.binding!!.labelNorek.setOnLongClickListener {
            val clipboardManager: ClipboardManager = activity.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
            val clip: ClipData = ClipData.newPlainText("label", holder.binding!!.labelNorek.getText())
            clipboardManager.setPrimaryClip(clip)
            Toast.makeText(activity, "Text disalin", Toast.LENGTH_SHORT).show()
            return@setOnLongClickListener true
        }

atau


holder.binding!!.labelNorek.setOnLongClickListener {
val clipboardManager: ClipboardManager = activity.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
val clip: ClipData = ClipData.newPlainText("label", holder.binding!!.labelNorek.getText())
clipboardManager.setPrimaryClip(clip)
Toast.makeText(activity, "Text disalin", Toast.LENGTH_SHORT).show()
true
}

SQLite convert date dalam bentuk integer ke format tertentu

Contoh kasus :

Saya punya aplikasi untuk menyimpan data pengeluaran harian saya berbasis android. Saya menggunakan room untuk DAO (data access object) ke database SQLite.

contoh Entity dalam java :

@Entity(tableName = "belanja")
public class BlanjaEntity {
@PrimaryKey(autoGenerate = true)
private Integer idBlanja;
private String ketegoriBlanja;
private String nameBlanja;
private String jumlahBlanja;
private Integer hargaBlanja;
private long tglBlanja;

//getter
//setter

}

Saya menggunakan kode dibawah untuk insert data ke database :

@Dao
public interface DaoBlanja {
@WorkerThread
@Insert(onConflict = OnConflictStrategy.FAIL)
void insertBlanja(BlanjaEntity b);
}

Saat data tersebut tersimpan di database maka akan disimpan dalam tipe data integer karena sqlite tidak memiliki tipe data date and time.

Baca keterangan di bawah :
SQLite does not have a storage class set aside for storing dates and/or times. Instead, the built-in Date And Time Functions of SQLite are capable of storing dates and times as TEXT, REAL, or INTEGER values:

  • TEXT as ISO8601 strings (“YYYY-MM-DD HH:MM:SS.SSS”).
  • REAL as Julian day numbers, the number of days since noon in Greenwich on November 24, 4714 B.C. according to the proleptic Gregorian calendar.
  • INTEGER as Unix Time, the number of seconds since 1970-01-01 00:00:00 UTC.

Applications can chose to store dates and times in any of these formats and freely convert between formats using the built-in date and time functions.
link sumber

Bagaimana jika anda ingin menampilkan data transaksi pengeluaran berdasarkan bulan tertentu ? Misalnya bulan september ? Untuk dapat menampilkan data berdasarkan bulan tertentu maka anda dapat menggunakan perintah strftime untuk mengformat interger menjadi format date / time.

Continue reading

Java String Tokens

Problem :
Given a string, s, matching the regular expression [A-Za-z !,?._'@]+, split the string into tokens. We define a token to be one or more consecutive English alphabetic letters. Then, print the number of tokens, followed by each token on a new line.

Sample Input :

He is a very very good boy, isn't he? Sample Output
10
He
is
a
very
very
good
boy
isn
t
he

Continue reading

Java Anagrams

Problem

Two strings,  a and b , are called anagrams if they contain all the same characters in the same frequencies. For example, the anagrams of CAT are CATACTTACTCAATC, and CTA.

Complete the function in the editor. If  a and  b are case-insensitive anagrams, print “Anagrams”; otherwise, print “Not Anagrams” instead.

Input Format

The first line contains a string denoting .
The second line contains a string denoting .

Output Format

Print “Anagrams” if  a and  b are case-insensitive anagrams of each other; otherwise, print “Not Anagrams” instead.

 

Sample Input 0

Continue reading

Java String Comparisons

Sample Input 0

welcometojava
3

Sample Output 0

ava
wel

Explanation 0

String  s = “welcome to java” has the following lexicographically-ordered substrings of length k = 3

["ava", "com", "elc", "eto", "jav", "lco", "met", "oja", "ome", "toj", "wel"]

We then return the first (lexicographically smallest) substring and the last (lexicographically largest) substring as two newline-separated values (i.e., ava\nwel).

The stub code in the editor then prints ava as our first line of output and wel as our second line of output.

Code

Continue reading

Cara Meningkatkan Max Upload Size WordPress

Berikut ini langkah-langkah untuk menambah ukuran max upload size diwordpress. Hal-hal yang anda perlukan adalah

  • akses kontrol ke panel hosting anda
  • akses ke halaman administrator wordpress

Metode 1. menggunakan .htaccess

Beberapa layanan hosting memperbolehkan pelanggannya untuk untuk mengganti setting PHP melalui file .htaccess. Silahkan buka file manager dan cari file .htaccess di directory public_html. Jika anda dapat menemukan file tersebut maka buka dan edit file tersebut dan tambah beberapa baris settingan dibawah :

Continue reading

Jenis-jenis Error pada saat membuat aplikasi android

Berikut error yang sering ditemui saat membuat aplikasi android :

  1. Manifest merger failed with multiple errors :
    penyebab: terdapat 2 file manifest / terdapat 2 main activity pada file manifest
    solusi  : periksa file manifest pada manifest file dan pastikan hanya 1 file manifest dengan 1 main activity
  2. ArrayIndexOutofBound :
    penyebab: akses ke index melebihi ukuran dari array
    solusi  : periksa index dari array yang diakses. jika ukuran array 10 maka index yang dapat diakses adalah dari index ke 0-9
  3. attempt to invoke virtual method on a null object reference:
    penyebab: objek/variabel belum di inisialisasi
    solusi  : periksa baris error pada log cat dan lakukan inisialisasi pada objek / variabel yang dipanggil.
  4. error setSupportActionbar menggunakan Toolbar
    penyebab:thema app / activity menggunakan style app.theme tetapi pada activity menggunakan setToolbar()
    solusi  : cek Thema app / activity pada manifest file pastikan menggunakan tema no_action_bar