Skip to content

Instantly share code, notes, and snippets.

View vicky7230's full-sized avatar
🎯
Focusing

Vipin Kumar vicky7230

🎯
Focusing
View GitHub Profile
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val button = findViewById(R.id.button)
val editText = findViewById(R.id.editText) as EditText
button.setOnClickListener {
@vicky7230
vicky7230 / InitActivity.java
Created May 26, 2017 07:05 — forked from kosiara/InitActivity.java
Android slf4j logger with logcat + file; logging to file and logcat on Android
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class InitActivity {
public InitActivity() {
logger.debug("Activity loading....");
}
@vicky7230
vicky7230 / fcm.php
Created May 12, 2017 07:51 — forked from sab99r/fcm.php
PHP Function to Send FCM Message to Android
<?php
/*
Parameter Example
$data = array('post_id'=>'12345','post_title'=>'A Blog post');
$target = 'single tocken id or topic name';
or
$target = array('token1','token2','...'); // up to 1000 in one request
*/
public function sendMessage($data,$target){
//FCM api URL
@vicky7230
vicky7230 / android_get_view_size.java
Created November 26, 2015 07:20 — forked from omorandi/android_get_view_size.java
Android: get the actual size of a match_parent/wrap_content view
view.post(new Runnable() {
@Override
public void run() {
int width = view.getWidth();
int height = view.getHeight();
//do something cool with width and height
}
});