Асинхронная загрузка веб страницы в Android Studio

private class DownloadWebPageTask extends AsyncTask<String, Void, String> { @Override protected String doInBackground(String… urls) { String response = «»; for (String url : urls) { DefaultHttpClient client = new DefaultHttpClient(); HttpGet httpGet = new HttpGet(url); try { HttpResponse execute = client.execute(httpGet); InputStream content = execute.getEntity().getContent(); BufferedReader buffer = new BufferedReader( new InputStreamReader(content)); String s = «»;… Читать далее »

Коды на прогноз погоды от Yahoo

Прогноз погоды в XML JSON форматах https://developer.yahoo.com/weather/ 0-tornado-Торнадо-5 1-tropical storm-Шторм-7 2-hurricane-Ураган-5 3-severe thunderstorms-Сильная гроза-7 4-thunderstorms-Сильный шторм-7 5-mixed rain and snow-Снег с дождем-5 6-mixed rain and sleet-Дождь и мокрый снег-4 7-mixed snow and sleet-Снег и мокрый снег-6 8-freezing drizzle-Изморозь-6 9-drizzle-Изморозь-6 10-freezing rain-град-4 11-showers-Ливень-4 12-showers-Ливень-4 13-snow flurries-Снег-6 14-light snow showers-Снег-6 15-blowing snow-Снег-6 16-snow-Снег-6 17-hail-Град-5 18-sleet-Мокрый снег-6 19-dust-Пыль-2… Читать далее »

Меню XML для пятнашек

<?xml version=»1.0″ encoding=»utf-8″?> <menu xmlns:android=»http://schemas.android.com/apk/res/android» xmlns:tools=»http://schemas.android.com/tools» tools:context=».MainActivity»> <item android:id=»@+id/action_menu» android:title=»menu»> <menu > <item android:id=»@+id/menu_item1″ android:title=»Новая игра»></item> <item android:id=»@+id/menu_item2″ android:title=»Выход»></item> </menu> </item> </menu>

Пятнашки на Андроид последняя версия

package sunshine.ikurs.kz.myapplication; import android.net.Uri; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.Button; import android.widget.Toast; import com.google.android.gms.appindexing.Action; import com.google.android.gms.appindexing.AppIndex; import com.google.android.gms.common.api.GoogleApiClient; import java.util.Random; public class MainActivity extends AppCompatActivity { //Объявляем массив кнопок Button[] B; /** * ATTENTION: This was auto-generated to implement the App Indexing API. * See https://g.co/AppIndexing/AndroidStudio for more information.… Читать далее »

Шаблон главной страницы

@import «https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css»; @import «animate.css»; *{ box-sizing:border-box; margin:0; padding:0; } body{ background:url(images/crossword.png); font-family: ‘calibri’,sans-serif; font-size:1.25em; line-height:1.5em; } a{ text-decoration:none; } #header,#content,#footer{ width:100%; float:left; border:1px solid #FFF; } #header,#footer{ background:rgba(0,0,0,0.7); } #content{ margin-top:67px; } #up{ position:fixed; width:50px; right:5%; bottom:5%; } .fix{ position:fixed; top:0; left:0; width:100%; } h1,h2{ text-align:center; margin:40px 0; border-bottom: 2px solid #ff0; line-height: 0; }… Читать далее »

Код XML для пятнашек на Андроид

<?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:paddingBottom=»@dimen/activity_vertical_margin» android:paddingLeft=»@dimen/activity_horizontal_margin» android:paddingRight=»@dimen/activity_horizontal_margin» android:paddingTop=»@dimen/activity_vertical_margin» tools:context=»sunshine.ikurs.kz.myapplication.MainActivity»> <TableLayout android:layout_width=»match_parent» android:layout_height=»match_parent» android:layout_alignParentTop=»true» android:layout_centerHorizontal=»true»> <TableRow android:layout_width=»match_parent» android:layout_height=»match_parent» android:layout_weight=».25″> <Button android:layout_width=»fill_parent» android:layout_height=»fill_parent» android:text=»1″ android:tag=»1″ android:id=»@+id/button1″ android:layout_column=»0″ android:layout_weight=».25″ android:onClick=»buttonOnClick» android:textSize=»26sp» /> <Button android:layout_width=»fill_parent» android:layout_height=»fill_parent» android:text=»2″ android:tag=»2″ android:id=»@+id/button2″ android:layout_column=»1″ android:layout_weight=».25″ android:textSize=»26sp» android:onClick=»buttonOnClick» /> <Button android:layout_width=»fill_parent» android:layout_height=»fill_parent» android:text=»3″ android:tag=»3″ android:id=»@+id/button3″ android:layout_column=»2″ android:layout_weight=».25″ android:textSize=»26sp» android:onClick=»buttonOnClick» />… Читать далее »

Код для пятнашек на Андроид

package sunshine.ikurs.kz.myapplication; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; public class MainActivity extends AppCompatActivity { //Объявляем массив кнопок Button [] B; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); //Создаем массив кнопок. B=new Button[16]; //Записываем кнопки в массив. B[0]=(Button)findViewById(R.id.button1); B[1]=(Button)findViewById(R.id.button2); B[2]=(Button)findViewById(R.id.button3); B[3]=(Button)findViewById(R.id.button4); B[4]=(Button)findViewById(R.id.button5); B[5]=(Button)findViewById(R.id.button6); B[6]=(Button)findViewById(R.id.button7); B[7]=(Button)findViewById(R.id.button8); B[8]=(Button)findViewById(R.id.button9); B[9]=(Button)findViewById(R.id.button10); B[10]=(Button)findViewById(R.id.button11); B[11]=(Button)findViewById(R.id.button12); B[12]=(Button)findViewById(R.id.button13); B[13]=(Button)findViewById(R.id.button14); B[14]=(Button)findViewById(R.id.button15); B[15]=(Button)findViewById(R.id.button16);… Читать далее »

Создаем новое приложение в Android Studio

Установим JAVA JDK пройдя по ссылке  http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html Установим Android studio с сайта http://developer.android.com/sdk/index.html Создаем первое приложение SunShine — прогноз погоды для Android. Основными целями нашего курса являются: Получение базовых знаний по Android Studio. Изучение Android API Освоение основных концепций построения мобильных приложений и программирование приложений в условиях ограниченных вычислительных и энергоресурсов. Получение знаний по разработке графического интерфейса… Читать далее »

Теги HTML

  Название Свойство Описание <p> абзац  </p> блочный тег Определяет текстовый абзац. Тег <p> является блочным элементом, всегда начинается с новой строки, абзацы текста идущие друг за другом разделяются между собой отбивкой. Величиной отбивки можно управлять с помощью стилей. Если закрывающего тега нет, считается, что конец абзаца совпадает с началом следующего блочного элемента. <br> Строчный… Читать далее »

15 урок Безопасность WordPress

define(‘DISALLOW_FILE_EDIT’, true); wp-config.php Duplicator — резервное копирование файлов и бд сайта WP-Optimize — оптимизация бд iThemes Security  Советы по безопасности в целом Первые мои советы коснуться вопросу работы с паролями. Это основа основ, фундамент! Не ленитесь следовать изложенным ниже правилам: используйте пароль длинной не менее 8 символов с буквами в разном регистре, числами и по… Читать далее »