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
Handler handler = new Handler(); | |
handler.postDelayed(new Runnable() { | |
@Override | |
public void run() { | |
Log.v("Log", "" + findViewById(R.id.qqq).getWidth()); | |
} | |
}, 100); |
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
MyProject/ | |
res/ | |
layout/ # default (portrait) | |
main.xml | |
layout-land/ # landscape | |
main.xml | |
layout-large/ # large (portrait) | |
main.xml | |
layout-large-land/ # large landscape | |
main.xml |
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
Size previewSize = camera.getParameters().getPreviewSize(); | |
float aspect = (float) previewSize.width / previewSize.height; | |
int previewSurfaceWidth = preview.getWidth(); | |
int previewSurfaceHeight = preview.getHeight(); | |
LayoutParams lp = preview.getLayoutParams(); | |
if (this.getResources().getConfiguration().orientation != Configuration.ORIENTATION_LANDSCAPE) | |
{ | |
// портретный вид |
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/sh | |
mkdir ~/down/ | |
cd ~/down/ | |
sudo apt-get install build-essential | |
wget http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tgz | |
tar -xzf Python-2.7.2.tgz | |
cd Python-2.7.2 | |
sudo apt-get install libsqlite3-dev zlib1g-dev libncurses5-dev | |
sudo apt-get install libgdbm-dev libbz2-dev libreadline5-dev | |
sudo apt-get install libssl-dev libdb-dev |
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 egobrain <egobrain@linux-ympb> | |
%%% @copyright (C) 2012, egobrain | |
%%% @doc | |
%%% Function for uploading files and properties,which were sent as a | |
%%% multipart. Files are stored in tmp_folder with random name, | |
%%% generated by tmp_filename function. | |
%%% @end | |
%%% Created : 25 Mar 2012 by egobrain <egobrain@linux-ympb> | |
%%%------------------------------------------------------------------- |
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
File file = ... | |
InputStream in = null; | |
try { | |
in = new BufferedInputStream(new FileInputStream(file)); | |
} catch (FileNotFoundException e1) { | |
e1.printStackTrace(); | |
} finally { | |
if (in != null) { | |
try { | |
in.close(); |
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
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
<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> |
OlderNewer