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 WindowManager.LayoutParams params = new WindowManager.LayoutParams( | |
WindowManager.LayoutParams.FLAG_FULLSCREEN, | |
WindowManager.LayoutParams.FLAG_FULLSCREEN, | |
WindowManager.LayoutParams.TYPE_SYSTEM_ALERT, | |
WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN, | |
PixelFormat.TRANSLUCENT); | |
WindowManager wm = (WindowManager) getApplicationContext() | |
.getSystemService(Context.WINDOW_SERVICE); |
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
Use: | |
NSURLSessionConfiguration:backgroundSessionConfiguration: | |
instead of | |
NSURLSessionConfiguration:defaultSessionConfiguration | |
From the NSURLSessionConfiguration:backgroundSessionConfiguration: documentation: | |
Upload and download tasks in background sessions are performed by an external daemon instead of by the app itself. As a result, the transfers continue in the background even if the app is suspended, exits, or crashes. | |
So in your case, change: |
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
public class Demo extends Activity { | |
private View.OnClickListener curlPostListener; | |
private Button curlPost; | |
/** Called when the activity is first created. */ | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.main); | |
InitializeApp(); | |
} |
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
2.3).NSURLSessionUploadTask | |
Upload Task sends data/file and it supports background uploads when the app is not running. | |
2.3.1) Create Upload task with system provided delegate methods. | |
/* Creates an upload task with the given request. The body of the request will be created from the file referenced by fileURL */ | |
- (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request fromFile:(NSURL *)fileURL; | |
/* Creates an upload task with the given request. The body of the request is provided from the bodyData. */ | |
- (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request fromData:(NSData *)bodyData; |
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
#!/bin/bash | |
set -e | |
## Utils | |
print_msg() { | |
echo "Frappe password: $FRAPPE_USER_PASS" | |
echo "MariaDB root password: $MSQ_PASS" |
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
%% @author Masahito Ikuta <cooldaemon@gmail.com> [http://d.hatena.ne.jp/cooldaemon/] | |
%% @copyright Masahito Ikuta 2008 | |
%% @doc UDP Server Behaviour. | |
%% Copyright 2008 Masahito Ikuta | |
%% | |
%% Licensed under the Apache License, Version 2.0 (the "License"); | |
%% you may not use this file except in compliance with the License. | |
%% You may obtain a copy of the License at | |
%% |
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
<resources> | |
<!-- Style you can use with a container (typically a horizontal | |
LinearLayout) to get the standard "button bar" background and | |
spacing. @hide --> | |
<style name="ButtonBar"> | |
<item name="android:paddingTop">5dip</item> | |
<item name="android:paddingStart">4dip</item> | |
<item name="android:paddingEnd">4dip</item> | |
<item name="android:paddingBottom">1dip</item> | |
<item name="android:background">@android:drawable/bottom_bar</item> |
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
P = spawn(actionModule,doAction1, [Params]), | |
P ! {self(), "Hello"}. | |
receive | |
{StartDoAction2} -> | |
doAction2(Params), | |
P2 =spawn(actionModule,doAction3, [Params]), | |
end. | |
doAction2(Params) -> doAnyAction. %% Выполнение POST запроса, ожидаем ответ 200 |
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
void ================================================ | |
File dir = new File ("data/user/VRP"); | |
List<File> files = null; | |
try { | |
files = getFileListing(dir); | |
} catch (FileNotFoundException e) { | |
e.printStackTrace(); | |
} | |
====================================================== | |
static public List<File> getFileListing( |
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
File file = ... | |
InputStream in = null; | |
try { | |
in = new BufferedInputStream(new FileInputStream(file)); | |
} catch (FileNotFoundException e1) { | |
e1.printStackTrace(); | |
} finally { | |
if (in != null) { | |
try { | |
in.close(); |
NewerOlder