Twitter Facebook Delicious Digg Stumbleupon Favorites More

Saturday, 30 June 2018

Failed to load AppCompat ActionBar with unknown error?

Failed to load AppCompat ActionBar with unknown error?

I had the same problem. Seems it is a Android Studio bug.
In your styles xml-file change this:
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
to this:
<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
Works for me.
Share:

Sunday, 24 June 2018

unable-to-resolve-dependency error solution

just go to Settings >Gradle >Disable Offline Work 
Share:

Saturday, 23 June 2018

all colour xml

<?xml version="1.0" encoding="utf-8"?><resources>
    <color name="colorPrimary">#3F51B5</color>
    <color name="colorPrimaryDark">#303F9F</color>
    <color name="colorAccent">#FF4081</color>
    <color name="White">#FFFFFF</color>
    <color name="Ivory">#FFFFF0</color>
    <color name="LightYellow">#FFFFE0</color>
    <color name="Yellow">#FFFF00</color>
    <color name="Snow">#FFFAFA</color>
    <color name="FloralWhite">#FFFAF0</color>
    <color name="LemonChiffon">#FFFACD</color>
    <color name="Cornsilk">#FFF8DC</color>
    <color name="Seashell">#FFF5EE</color>
    <color name="LavenderBlush">#FFF0F5</color>
    <color name="PapayaWhip">#FFEFD5</color>
    <color name="BlanchedAlmond">#FFEBCD</color>
    <color name="MistyRose">#FFE4E1</color>
    <color name="Bisque">#FFE4C4</color>
    <color name="Moccasin">#FFE4B5</color>
    <color name="NavajoWhite">#FFDEAD</color>
    <color name="PeachPuff">#FFDAB9</color>
    <color name="Gold">#FFD700</color>
    <color name="Pink">#FFC0CB</color>
    <color name="LightPink">#FFB6C1</color>
    <color name="Orange">#FFA500</color>
    <color name="LightSalmon">#FFA07A</color>
    <color name="DarkOrange">#FF8C00</color>
    <color name="Coral">#FF7F50</color>
    <color name="HotPink">#FF69B4</color>
    <color name="Tomato">#FF6347</color>
    <color name="OrangeRed">#FF4500</color>
    <color name="DeepPink">#FF1493</color>
    <color name="Fuchsia">#FF00FF</color>
    <color name="Magenta">#FF00FF</color>
    <color name="Red">#FF0000</color>
    <color name="OldLace">#FDF5E6</color>
    <color name="LightGoldenrodYellow">#FAFAD2</color>
    <color name="Linen">#FAF0E6</color>
    <color name="AntiqueWhite">#FAEBD7</color>
    <color name="Salmon">#FA8072</color>
    <color name="GhostWhite">#F8F8FF</color>
    <color name="MintCream">#F5FFFA</color>
    <color name="WhiteSmoke">#F5F5F5</color>
    <color name="Beige">#F5F5DC</color>
    <color name="Wheat">#F5DEB3</color>
    <color name="SandyBrown">#F4A460</color>
    <color name="Azure">#F0FFFF</color>
    <color name="Honeydew">#F0FFF0</color>
    <color name="AliceBlue">#F0F8FF</color>
    <color name="Khaki">#F0E68C</color>
    <color name="LightCoral">#F08080</color>
    <color name="PaleGoldenrod">#EEE8AA</color>
    <color name="Violet">#EE82EE</color>
    <color name="DarkSalmon">#E9967A</color>
    <color name="Lavender">#E6E6FA</color>
    <color name="LightCyan">#E0FFFF</color>
    <color name="BurlyWood">#DEB887</color>
    <color name="Plum">#DDA0DD</color>
    <color name="Gainsboro">#DCDCDC</color>
    <color name="Crimson">#DC143C</color>
    <color name="PaleVioletRed">#DB7093</color>
    <color name="Goldenrod">#DAA520</color>
    <color name="Orchid">#DA70D6</color>
    <color name="Thistle">#D8BFD8</color>
    <color name="LightGrey">#D3D3D3</color>
    <color name="Tan">#D2B48C</color>
    <color name="Chocolate">#D2691E</color>
    <color name="Peru">#CD853F</color>
    <color name="IndianRed">#CD5C5C</color>
    <color name="MediumVioletRed">#C71585</color>
    <color name="Silver">#C0C0C0</color>
    <color name="DarkKhaki">#BDB76B</color>
    <color name="RosyBrown">#BC8F8F</color>
    <color name="MediumOrchid">#BA55D3</color>
    <color name="DarkGoldenrod">#B8860B</color>
    <color name="FireBrick">#B22222</color>
    <color name="PowderBlue">#B0E0E6</color>
    <color name="LightSteelBlue">#B0C4DE</color>
    <color name="PaleTurquoise">#AFEEEE</color>
    <color name="GreenYellow">#ADFF2F</color>
    <color name="LightBlue">#ADD8E6</color>
    <color name="DarkGray">#A9A9A9</color>
    <color name="Brown">#A52A2A</color>
    <color name="Sienna">#A0522D</color>
    <color name="YellowGreen">#9ACD32</color>
    <color name="DarkOrchid">#9932CC</color>
    <color name="PaleGreen">#98FB98</color>
    <color name="DarkViolet">#9400D3</color>
    <color name="MediumPurple">#9370DB</color>
    <color name="LightGreen">#90EE90</color>
    <color name="DarkSeaGreen">#8FBC8F</color>
    <color name="SaddleBrown">#8B4513</color>
    <color name="DarkMagenta">#8B008B</color>
    <color name="DarkRed">#8B0000</color>
    <color name="BlueViolet">#8A2BE2</color>
    <color name="LightSkyBlue">#87CEFA</color>
    <color name="SkyBlue">#87CEEB</color>
    <color name="Gray">#808080</color>
    <color name="Olive">#808000</color>
    <color name="Purple">#800080</color>
    <color name="Maroon">#800000</color>
    <color name="Aquamarine">#7FFFD4</color>
    <color name="Chartreuse">#7FFF00</color>
    <color name="LawnGreen">#7CFC00</color>
    <color name="MediumSlateBlue">#7B68EE</color>
    <color name="LightSlateGray">#778899</color>
    <color name="SlateGray">#708090</color>
    <color name="OliveDrab">#6B8E23</color>
    <color name="SlateBlue">#6A5ACD</color>
    <color name="DimGray">#696969</color>
    <color name="MediumAquamarine">#66CDAA</color>
    <color name="CornflowerBlue">#6495ED</color>
    <color name="CadetBlue">#5F9EA0</color>
    <color name="DarkOliveGreen">#556B2F</color>
    <color name="Indigo">#4B0082</color>
    <color name="MediumTurquoise">#48D1CC</color>
    <color name="DarkSlateBlue">#483D8B</color>
    <color name="SteelBlue">#4682B4</color>
    <color name="RoyalBlue">#4169E1</color>
    <color name="Turquoise">#40E0D0</color>
    <color name="MediumSeaGreen">#3CB371</color>
    <color name="LimeGreen">#32CD32</color>
    <color name="DarkSlateGray">#2F4F4F</color>
    <color name="SeaGreen">#2E8B57</color>
    <color name="ForestGreen">#228B22</color>
    <color name="LightSeaGreen">#20B2AA</color>
    <color name="DodgerBlue">#1E90FF</color>
    <color name="MidnightBlue">#191970</color>
    <color name="Aqua">#00FFFF</color>
    <color name="Cyan">#00FFFF</color>
    <color name="SpringGreen">#00FF7F</color>
    <color name="Lime">#00FF00</color>
    <color name="MediumSpringGreen">#00FA9A</color>
    <color name="DarkTurquoise">#00CED1</color>
    <color name="DeepSkyBlue">#00BFFF</color>
    <color name="DarkCyan">#008B8B</color>
    <color name="Teal">#008080</color>
    <color name="Green">#008000</color>
    <color name="DarkGreen">#006400</color>
    <color name="Blue">#0000FF</color>
    <color name="MediumBlue">#0000CD</color>
    <color name="DarkBlue">#00008B</color>
    <color name="Navy">#000080</color>
    <color name="Black">#000000</color>
    <color name="orange">#ff5500</color>
    <color name="white">#ffffff</color>
    <color name="transparent">#00000000</color>
    <color name="date_color">#999999</color>
    <color name="black">#000000</color>
    <color name="gray">#999999</color>
    <color name="blue">#0066cc</color>
    <color name="gold">#e6b121</color>
    <color name="blueback">#99FFFF</color>
    <color name="articlecolor">#3399FF</color>
    <color name="article_title">#3399FF</color>
    <color name="cachecolor">#8ad0e8</color>

    <color name="yellow">#FFFF00</color>
    <color name="fuchsia">#FF00FF</color>
    <color name="red">#FF0000</color>
    <color name="silver">#C0C0C0</color>

    <color name="olive">#808000</color>
    <color name="purple">#800080</color>
    <color name="maroon">#800000</color>
    <color name="aqua">#00FFFF</color>
    <color name="lime">#00FF00</color>
    <color name="teal">#008080</color>
    <color name="green">#008000</color>

    <color name="navy">#000080</color>


    <color name="ivory">#FFFFF0</color>
    <color name="light_yellow">#FFFFE0</color>
  
    <color name="snow">#FFFAFA</color>
    <color name="floral_white">#FFFAF0</color>
    <color name="lemon_chiffon">#FFFACD</color>
    <color name="cornsilk">#FFF8DC</color>
    <color name="seashell">#FFF5EE</color>
    <color name="lavender_blush">#FFF0F5</color>
    <color name="papaya_whip">#FFEFD5</color>
    <color name="blanched_almond">#FFEBCD</color>
    <color name="misty_rose">#FFE4E1</color>
    <color name="bisque">#FFE4C4</color>
    <color name="moccasin">#FFE4B5</color>
    <color name="navajo_white">#FFDEAD</color>
    <color name="peach_puff">#FFDAB9</color>
    <color name="cold">#FFD700</color>
    <color name="pink">#FFC0CB</color>
    <color name="light_pink">#FFB6C1</color>

    <color name="light_salmon">#FFA07A</color>
    <color name="dark_orange">#FF8C00</color>
    <color name="coral">#FF7F50</color>
    <color name="hot_pink">#FF69B4</color>
    <color name="tomato">#FF6347</color>
    <color name="orange_red">#FF4500</color>
    <color name="deep_pink">#FF1493</color>

    <color name="magenta">#FF00FF</color>

    <color name="old_lace">#FDF5E6</color>
    <color name="light_goldenrod_yellow">#FAFAD2</color>
    <color name="linen">#FAF0E6</color>
    <color name="antique_white">#FAEBD7</color>
    <color name="salmon">#FA8072</color>
    <color name="ghost_white">#F8F8FF</color>
    <color name="mint_cream">#F5FFFA</color>
    <color name="white_smoke">#F5F5F5</color>
    <color name="beige">#F5F5DC</color>
    <color name="wheat">#F5DEB3</color>
    <color name="sandy_brown">#F4A460</color>
    <color name="azure">#F0FFFF</color>
    <color name="honeydew">#F0FFF0</color>
    <color name="alice_blue">#F0F8FF</color>
    <color name="khaki">#F0E68C</color>
    <color name="light_coral">#F08080</color>
    <color name="pale_goldenrod">#EEE8AA</color>
    <color name="violet">#EE82EE</color>
    <color name="dark_salmon">#E9967A</color>
    <color name="lavender">#E6E6FA</color>
    <color name="light_cyan">#E0FFFF</color>
    <color name="burlyWood">#DEB887</color>
    <color name="plum">#DDA0DD</color>
    <color name="gainsboro">#DCDCDC</color>
    <color name="crimson">#DC143C</color>
    <color name="pale_violet_red">#DB7093</color>
    <color name="goldenrod">#DAA520</color>
    <color name="orchid">#DA70D6</color>
    <color name="thistle">#D8BFD8</color>
    <color name="light_grey">#D3D3D3</color>
    <color name="tan">#D2B48C</color>
    <color name="chocolate">#D2691E</color>
    <color name="peru">#CD853F</color>
    <color name="indian_red">#CD5C5C</color>
    <color name="medium_violet_red">#C71585</color>

    <color name="dark_khaki">#BDB76B</color>
    <color name="rosy_brown">#BC8F8F</color>
    <color name="medium_orchid">#BA55D3</color>
    <color name="dark_goldenrod">#B8860B</color>
    <color name="fire_brick">#B22222</color>
    <color name="powder_blue">#B0E0E6</color>
    <color name="light_steel_blue">#B0C4DE</color>
    <color name="pale_turquoise">#AFEEEE</color>
    <color name="greenYellow">#ADFF2F</color>
    <color name="light_blue">#ADD8E6</color>
    <color name="dark_gray">#A9A9A9</color>
    <color name="brown">#A52A2A</color>
    <color name="sienna">#A0522D</color>
    <color name="yellow_green">#9ACD32</color>
    <color name="dark_orchid">#9932CC</color>
    <color name="pale_green">#98FB98</color>
    <color name="dark_violet">#9400D3</color>
    <color name="mediumPurple">#9370DB</color>
    <color name="_light_green">#90EE90</color>
    <color name="dark_sea_green">#8FBC8F</color>
    <color name="saddle_brown">#8B4513</color>
    <color name="dark_magenta">#8B008B</color>
    <color name="dark_red">#8B0000</color>
    <color name="blue_violet">#8A2BE2</color>
    <color name="light_sky_blue">#87CEFA</color>
    <color name="sky_blue">#87CEEB</color>

    <color name="aquamarine">#7FFFD4</color>
    <color name="chartreuse">#7FFF00</color>
    <color name="lawn_green">#7CFC00</color>
    <color name="medium_slate_blue">#7B68EE</color>
    <color name="light_slate_gray">#778899</color>
    <color name="slate_gray">#708090</color>
    <color name="olive_drab">#6B8E23</color>
    <color name="slate_blue">#6A5ACD</color>
    <color name="dim_gray">#696969</color>
    <color name="medium_aquamarine">#66CDAA</color>
    <color name="cornflower_blue">#6495ED</color>
    <color name="cadet_blue">#5F9EA0</color>
    <color name="dark_olive_green">#556B2F</color>
    <color name="indigo">#4B0082</color>
    <color name="medium_turquoise">#48D1CC</color>
    <color name="dark_slate_blue">#483D8B</color>
    <color name="steel_blue">#4682B4</color>
    <color name="royal_blue">#4169E1</color>
    <color name="turquoise">#40E0D0</color>
    <color name="medium_sea_green">#3CB371</color>
    <color name="lime_green">#32CD32</color>
    <color name="dark_slate_gray">#2F4F4F</color>
    <color name="sea_green">#2E8B57</color>
    <color name="forest_green">#228B22</color>
    <color name="light_sea_green">#20B2AA</color>
    <color name="dodger_blue">#1E90FF</color>
    <color name="midnight_blue">#191970</color>

    <color name="cyan">#00FFFF</color>
    <color name="spring_green">#00FF7F</color>

    <color name="medium_spring_green">#00FA9A</color>
    <color name="dark_turquoise">#00CED1</color>
    <color name="deep_sky_blue">#00BFFF</color>
    <color name="dark_cyan">#008B8B</color>

    <color name="dark_green">#006400</color>

    <color name="medium_blue">#0000CD</color>
    <color name="dark_blue">#00008B</color>

</resources>
Share:

Thursday, 21 June 2018

firebase test


  1. a

package com.example.raj.firebasehindi;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.firebase.client.Firebase;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;

public class MainActivity extends AppCompatActivity {
Button bt;
Firebase url;
    @Override    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        // Write a message to the database       // FirebaseDatabase database = FirebaseDatabase.getInstance();       // DatabaseReference myRef = database.getReference("message");
      //  myRef.setValue("Hello, World!");        Firebase.setAndroidContext(this);
        bt=(Button)findViewById(R.id.button);
        url=new Firebase("https://fir-test-e769d.firebaseio.com/");
        bt.setOnClickListener(new View.OnClickListener() {
            @Override            public void onClick(View view) {
Firebase firebase=url.child("Name");
firebase.setValue("htd");
            }
        });
    }
}
  1. 1
  2. 1
  3. 1
  4. 1
Share:

Render problem Failed to load AppCompat ActionBar with unknown error.



REPLACE 3 WITH 1 

Share:

Sunday, 3 June 2018

LAYOUT IN ANDROID


https://www.androidhive.info/2011/07/android-layouts-linear-layout-relative-layout-and-table-layout/

1. Linear Layout
2. Relative Layout
3. Table Layout
4. Grid View
5. Tab Layout
6. List View

1. Linear Layout

In a linear layout, like the name suggests, all the elements are displayed in a linear fashion(below is an example of the linear layouts), either Horizontally or Vertically and this behavior is set in android:orientation which is an attribute of the node LinearLayout.

Example of Vertical layout snippet

<LinearLayout android:orientation="vertical"> .... </LinearLayout>
Example of Horizontal layout snippet

<LinearLayout android:orientation="horizontal"> .... </LinearLayout>
Android Layout

2. Relative Layout

In a relative layout every element arranges itself relative to other elements or a parent element.
As an example, lets consider the layout defined below. The “Cancel” button is placed relatively, to the right of the “Login” button parallely. Here is the code snippet that achieves the mentioned alignment (Right of Login button parallely)

Example code snippet

<Button android:id="@+id/btnLogin" ..></Button>

<Button android:layout_toRightOf="@id/btnLogin"
            android:layout_alignTop="@id/btnLogin" ..></Button>

3. Table Layout

Table layouts in Android works in the same way HTML table layouts work. You can divide your layouts into rows and columns. Its very easy to understand. The image below should give you an idea.

Table layout

<!-- Row 2 with 3 columns -->
    <TableRow 
        android:id="@+id/tableRow1" 
        android:layout_height="wrap_content" 
        android:layout_width="match_parent">  
        <TextView 
            android:id="@+id/TextView04" android:text="Row 2 column 1"
            android:layout_weight="1" android:background="#dcdcdc"
            android:textColor="#000000"
            android:padding="20dip" android:gravity="center"/>  
        <TextView 
            android:id="@+id/TextView04" android:text="Row 2 column 2"
            android:layout_weight="1" android:background="#d3d3d3"
            android:textColor="#000000"
            android:padding="20dip" android:gravity="center"/>
        <TextView 
            android:id="@+id/TextView04" android:text="Row 2 column 3"
            android:layout_weight="1" android:background="#cac9c9"
            android:textColor="#000000"
            android:padding="20dip" android:gravity="center"/>
    </TableRow> 
Share:

Blogger Tutorials

Blogger Templates

Sample Text

Copyright © ANDROID TUTORIAL CODE | Powered by Blogger
Design by SimpleWpThemes | Blogger Theme by NewBloggerThemes.com & Distributed By Protemplateslab