Okhelp.cz

Recepty, články, nápady, programování. Dříve dum-zahrada, finance, internet a know-how.okhelp.cz Pro lepší výsledky hledání používejte i diakritiku.

WebView change height Android Example


AD MOB

The Android WebView changing the height according to text size.
If you need to change the height to a minimum try this source:

//public void loadDataWithBaseURL (String baseUrl, String data, String mimeType, String encoding, String historyUrl) 
WebView _webView; // findById(.....
String entryContent = "";
 _webView.loadDataWithBaseURL(
	"blabol",//  javascript i styly
	entryContent, null,
	"utf-8", null
);


397LW NO topic_id




AD

Další témata ....(Topics)


229

Which version of eclipse for android development | which-version-of-eclipse-for-android-development


I tried this Eclipse and work fine:
Eclipse Classic
//www.filehippo.com/download_eclipse_classic_32/

Eclipse Juno
Eclipse Helios

//developer.android.com/tools/sdk/eclipse-adt.html
24

Sqlite create database and table with BAT file for Android | sqlite-create-database-and-table-with-bat-file


Sqlite3 create database and table with load.bat file and fill data to table example.


  1. Create folder for your project: my_sqlite_project

  2. Open folder and create file load.bat and paste to load.bat this text and save to project folder:


    sqlite3 my_database.s3db < load_text.sql
    pause



  3. Create load_text.sql file and paste this text and save to project folder:

    CREATE TABLE [android_metadata] (
    [locale] TEXT
    );




    CREATE TABLE [my_table] (
    [_id] int NULL,
    [word] VARCHAR(255) NULL,
    [description] VARCHAR(255) NULL




    .separator ";"
    .import text_file.txt my_table


  4. Create text_file.txt and paste this text and save it as UTF-8:

    1;word1;my first word
    2;word2; my second word



  5. Download sqlite3.exe and put to project folder.

  6. Run BAT file load.bat and read text instruction from console

  7. If database created you can open and edit this with sqlite database explorer

  8. Copy database to Asses Android project folder

  9. If you want using this database in Android application on device, you have to copy this database to folder on device /data/data/com.MyPackage/databases/









192

Samsung Galaxy Pocket - Android | samsung-galaxy-pocket-android


Nejmenší telefon od Samsungu s Androidem se někdy přidává i jako dárek k zakoupenému zboží, přesto tento telefon toho za svou cenu něco přes 2 000 korun umí hodně.
Technické parametry Samsung Galaxy Pocket
Rozměry a hmotnost: 103,70 × 57,50 × 12 mm, 97 g
Sítě GSM 850 / 900 / 1800 / 1900 MHz, W-CDMA (3G) 900 MHz / 2 100 MHz
Displej TFT TN, 2,80" (320 × 240 px), dotykový: kapacitní
Procesor 832 MHz
Paměť RAM 256 MB, vnitřní paměť 3 GB, paměťové karty microSD
Operační systém Android 2.3, údajně nelze upgradovat
Hudba: mp3, aac, wav, wma
Video: mp4, 3gp, 320 × 240 px, 15 FPS
Fotoaparát 2 Mpx
Navigace vestavěná GPS, elektronický kompas
Baterie 1 200 mAh, pohotovostní doba: 312 hodin
Cena něco přes 2 000 korun / léto 2012

samsung-galaxy-pocket
160

Linkify text link url in TextView text Android example | linkify-text-link-url-in-textview-text-android-example


Example from SDK C:\Program Files\Android\android-sdk-windows\samples\android-10\ApiDemos\src\com\example\android\apis\text\Link.java
Source: //developer.android.com/resources/browser.html?tag=sample
License: //www.apache.org/licenses/LICENSE-2.0
1.) Automatically linkifies using android:autoLink="all"

// res/values/strings.xml
<string name="link_text_auto"><b>text1:</b> This is some text.  In
      this text are some things that are actionable.  For instance,
      you can click on //www.google.com and it will launch the
      web browser.  You can click on google.com too.  And, if you
      click on (415) 555-1212 it should dial the phone.
    </string>
// main.xml
<!-- text1 automatically linkifies things like URLs and phone numbers. -->
  <TextView xmlns:android="//schemas.android.com/apk/res/android"
            android:id="@+id/text1"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:autoLink="all"
            android:text="@string/link_text_auto"
            />


2.) Link text by setMovementMethod

// MainActivity.java onCreate
/*Be warned that if you want a TextView with a key listener or movement method not to be focusable, or if you want a TextView without a key listener or movement method to be focusable, you must call setFocusable(boolean) again after calling this to get the focusability back the way you want it. */

TextView t2 = (TextView) findViewById(R.id.text2);
t2.setMovementMethod(LinkMovementMethod.getInstance());

// main.xml
<!-- text2 uses a string resource containing explicit <a> tags to
       specify links. -->
  <TextView xmlns:android="//schemas.android.com/apk/res/android"
            android:id="@+id/text2"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:text="@string/link_text_manual"
            />

//strings.xml

<string name="link_text_manual"><b>text2:</b> This is some other
      text, with a <a href="//www.google.com">link</a> specified
      via an <a> tag.  Use a \"tel:\" URL
      to <a href="tel:4155551212">dial a phone number</a>.
    </string>






3.) Link as html code using Html.fromHtml()

// MainActivity.java onCreate
        TextView t3 = (TextView) findViewById(R.id.text3);
        t3.setText(
            Html.fromHtml(
                "<b>text3:</b>  Text with a " +
                "<a href=\"//www.google.com\">link</a> " +
                "created in the Java source code using HTML."));
        t3.setMovementMethod(LinkMovementMethod.getInstance());




4.) Link string by SpannableString

        SpannableString ss = new SpannableString(
            "text4: Click here to dial the phone.");

        ss.setSpan(new StyleSpan(Typeface.BOLD), 0, 6,
                   Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
        ss.setSpan(new URLSpan("tel:4155551212"), 13, 17,
                   Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);

        TextView t4 = (TextView) findViewById(R.id.text4);
        t4.setText(ss);
        t4.setMovementMethod(LinkMovementMethod.getInstance());


linkify link url adress text in Android
326

phpbb forum mobile friendly theme style | phpbb-forum-mobile-friendly-theme-style


- download any mobile styles for example //www.artodia.com/phpbb-styles/mobile/
- unzip style into your forum style folder for example all art_mobile folder copy into 0:/myweb/forum/styles/
- folow instalation istructions //www.artodia.com/phpbb-styles/mobile/tutorials/mobile-detection/
- check url result on https://www.google.com/webmasters/tools/mobile-friendly


Editace: 2012-01-07 09:00:43
Počet článků v kategorii: 397
Url:webview-change-height-android-example

AD
11 Share
Share
Tweet