This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How to programmatically take a screenshot in Android? | |
Reference: http://stackoverflow.com/a/5651242 | |
Here is the code that allowed my screenshot to be stored on sd card and used later for whatever your needs are: | |
First, add proper permission to save file: | |
And this is the code (running in an Activity): | |
private void takeScreenshot() { Date now = new Date(); android.text.format.DateFormat.format("yyyy-MM-dd_hh:mm:ss", now); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Open pdf files located inside the App (raw folder) Android | |
try { | |
copyFile(getResources().openRawResource(R.raw.yardim), | |
new FileOutputStream(new File(dirpicture, "yardim_copy.pdf"))); | |
File pdfFile = new File(dirpicture, "yardim_copy.pdf"); | |
Uri path = Uri.fromFile(pdfFile); | |
Intent intent = new Intent(Intent.ACTION_VIEW); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//AndroidManifest.xml | |
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/> | |
//public class ControllerService extends Service { | |
Dialog dialog; | |
//public void onCreate() | |
try{ | |
View checkBoxView = View.inflate(this, R.layout.dialog_gps_uyarisi, null); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MainPage = new NavigationPage(new Main()); | |
Main.cs | |
public class Main : ContentPage | |
{ | |
public Main() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App.cs | |
MainPage = new NavigationPage(new Main()); | |
Main.cs | |
public class Main : ContentPage | |
{ | |
public Main() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final EditText edittext = (EditText) findViewById(R.id.edittext); | |
edittext.setOnKeyListener(new View.OnKeyListener() { | |
public boolean onKey(View v, int keyCode, KeyEvent event) { | |
if ((event.getAction() == KeyEvent.ACTION_DOWN) && (keyCode == KeyEvent.KEYCODE_ENTER)) { | |
Toast.makeText(YourActivity.this, edittext.getText(), Toast.LENGTH_SHORT).show(); | |
return true; | |
} | |
return false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(compile 'com.google.android.gms:play-services-places:11.4.2') | |
------------------------------------------------------------------------ | |
AndroidManifest.xml | |
<meta-data | |
android:name="com.google.android.geo.API_KEY" | |
android:value="@string/google_maps_key"/> | |
--------------------------------------------------------------------------- | |
MapsActivity | |
PlaceAutocompleteFragment autocompleteFragment = (PlaceAutocompleteFragment) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<shape | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
android:shape="rectangle"> | |
<!-- background color --> | |
<solid | |
android:color="@color/theme_color_white"> | |
</solid> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: Playground - noun: a place where people can play | |
import UIKit | |
// arrays | |
var favoriteMovie=["dizi1","dizi2","dizi3"] | |
favoriteMovie[0] | |
favoriteMovie[1]="dizi 99" | |
favoriteMovie.count | |
favoriteMovie.isEmpty | |
favoriteMovie.append("yeni1") |