Skip to content

Instantly share code, notes, and snippets.

View vamsitallapudi's full-sized avatar
🚩
Become better than yesterday

Vamsi Tallapudi vamsitallapudi

🚩
Become better than yesterday
View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.coderefer.androidsplashscreenexample">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<activity
package com.coderefer.androidsplashscreenexample;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
/**
* Created by vamsikrishna on 12-Feb-15.
*/
public class SplashScreen extends Activity {
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/splash_image"
android:orientation="vertical"/>
<?php
$file_path = "uploads/";
$file_path = $file_path . basename( $_FILES['uploaded_file']['name']);
if(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $file_path) ){
echo "success";
} else{
echo "fail";
}
?>
package com.coderefer.uploadfiletoserver;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
package com.coderefer.uploadfiletoserver;
/**
* Created by vamsi on 24-Feb-16.
*/
import android.content.ContentUris;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorAccent"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.coderefer.uploadfiletoserver.MainActivity">
<TextView
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
// if parameter is a single lambda expression, we can omit the paranthesis
list.forEach { println() }
val list = listOf(1, 3, 5, 7, 9)
// a function taking a single function as a parameter
list.forEach({ println(it) }) //it -> iterator which iterates and gives each value of list