try { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.google.android.googlequicksearchbox"))); }catch (ActivityNotFoundException e) { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=com.google.android.googlequicksearchbox"))); }
Sunday, 29 July 2018
rate us button android code
Friday, 27 July 2018
read string value from resource
https://www.dev2qa.com/how-to-read-string-value-array-from-strings-xml-in-android/
<resources> <string name="button_show_selection">Show Selection</string> <string name="auto_complete_text_view_car">Input Favorite Car Name</string> </resources>
String defaultInputText = getResources().getString(R.string.auto_complete_text_view_car);
- Define a string array in strings.xml use string-array xml element.
<resources> <string name="button_show_selection">Show Selection</string> <string name="auto_complete_text_view_car">Input Favorite Car Name</string> <string-array name="car_array"> <item>Audi</item> <item>BMW</item> <item>Benz</item> <item>Ford</item> <item>Toyota</item> <item>Tesla</item> <item>Honda</item> <item>Hyundai</item> </string-array> </resources>- Read the string array in java source code. Please note car_array is just the string array name defined in strings.xml.
String carArr[] = getResources().getStringArray(R.array.car_array);
intent data passing example
In your current Activity, create a new
Intent
:String value="Hello world";
Intent i = new Intent(CurrentActivity.this, NewActivity.class);
i.putExtra("key",value);
startActivity(i);
Then in the new Activity, retrieve those values:
Bundle extras = getIntent().getExtras();
if (extras != null) {
String value = extras.getString("key");
//The key argument here must match that used in the other activity
}
Thursday, 26 July 2018
Arti App
- xml file
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".MainActivity"> <ScrollView android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <TextView android:layout_width="match_parent" android:layout_height="240dp" android:background="@drawable/banner" android:gravity="bottom" android:textAlignment="center" /> <!--FIRST ROW START FIRST ROW START FIRST ROW START FIRST ROW START FIRST ROW START FIRST ROW START --> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:weightSum="3"> <LinearLayout android:id="@+id/one" android:layout_width="0dp" android:layout_height="120dp" android:layout_margin="2dp" android:layout_weight="1" android:background="@color/colorGrapeFruit" android:orientation="vertical"> <ImageView android:layout_width="60dp" android:layout_height="60dp" android:layout_gravity="center" android:layout_marginTop="20dp" android:src="@drawable/tt" android:tint="@color/colorWhite" /> ye dusre type ke image ke liye <TextView android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/colorGrapeFruitDark" android:padding="8dp" android:text="Durga ji" android:textAlignment="center" android:textColor="@color/colorWhite" android:textSize="18dp" /> </LinearLayout> <!--sec--> <LinearLayout android:id="@+id/two" android:layout_width="0dp" android:layout_height="120dp" android:layout_margin="2dp" android:layout_weight="1" android:background="@color/colorBitterSweet" android:orientation="vertical"> <ImageView android:layout_width="30dp" android:layout_height="30dp" android:layout_gravity="center" android:layout_marginTop="20dp" android:src="@drawable/ic_77_essential_icons_diary" android:tint="@color/colorWhite" /> <TextView android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginTop="30dp" android:background="@color/colorBitterSweetDark" android:padding="8dp" android:text="Ganesh ji marathoi" android:textAlignment="center" android:textColor="@color/colorWhite" android:textSize="18dp" /> </LinearLayout> <!--comp--> <!--THIRD--> <LinearLayout android:id="@+id/three" android:layout_width="0dp" android:layout_height="120dp" android:layout_margin="2dp" android:layout_weight="1" android:background="@color/colorFlower" android:orientation="vertical"> <ImageView android:layout_width="30dp" android:layout_height="30dp" android:layout_gravity="center" android:layout_marginTop="20dp" android:src="@drawable/ic_77_essential_icons_credit_card" android:tint="@color/colorWhite" /> <TextView android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginTop="30dp" android:background="@color/colorFlowerDark" android:padding="8dp" android:text="karpur gavram" android:textAlignment="center" android:textColor="@color/colorWhite" android:textSize="18dp" /> </LinearLayout>
- colour <?xml version="1.0" encoding="utf-8"?>
<resources> <color name="colorPrimary">#dd3333</color> <color name="colorPrimaryDark">#d11616</color> <color name="colorAccent">#ff4081</color> <color name="colorWhite">#FFFFFF</color> <color name="colorGrapeFruit">#ed5565</color> <color name="colorGrapeFruitDark">#da4453</color> <color name="colorBitterSweet">#fc6e51</color> <color name="colorBitterSweetDark">#e9573f</color> <color name="colorFlower">#ffce54</color> <color name="colorFlowerDark">#f68b42</color> <color name="colorGrass">#A0D468</color> <color name="colorGrassDark">#8CC152</color> <color name="colorBlueJeans">#509CEC</color> <color name="colorBlueJeansDark">#4A89DC</color> <color name="colorLavander">#ac92ec</color> <color name="colorLavanderDark">#967adc</color> <color name="colorMint">#48cfad</color> <color name="colorMintDark">#37bc9b</color> <color name="colorAqua">#4fc1e9</color> <color name="colorAquaDark">#3bafda</color> <color name="colorPinkRose">#EC87C0</color> <color name="colorPinkRoseDark">#D770AD</color> </resources>
- 3
Tuesday, 24 July 2018
colour code
<color name="colorPrimary">#dd3333</color> | |
<color name="colorPrimaryDark">#d11616</color> | |
<color name="colorAccent">#FF4081</color> | |
<color name="colorWhite">#FFFFFF</color> | |
<color name="colorGrapeFruit">#ED5565</color> | |
<color name="colorGrapeFruitDark">#DA4453</color> | |
<color name="colorBitterSweet">#FC6E51</color> | |
<color name="colorBitterSweetDark">#E9573F</color> | |
<color name="colorFlower">#FFCE54</color> | |
<color name="colorFlowerDark">#F68B42</color> | |
<color name="colorGrass">#A0D468</color> | |
<color name="colorGrassDark">#8CC152</color> | |
<color name="colorBlueJeans">#509CEC</color> | |
<color name="colorBlueJeansDark">#4A89DC</color> | |
<color name="colorLavander">#AC92EC</color> | |
<color name="colorLavanderDark">#967ADC</color> | |
<color name="colorMint">#48CFAD</color> | |
<color name="colorMintDark">#37BC9B</color> | |
<color name="colorAqua">#4FC1E9</color> | |
<color name="colorAquaDark">#3BAFDA</color> | |
<color name="colorPinkRose">#EC87C0</color> | |
<color name="colorPinkRoseDark">#D770AD</color> |
Sunday, 22 July 2018
kotlin for loop
fun main(args:Array<String>) { for (item in 1..5) { println("hey theree $item") } }
- OUTPUT
- hey theree 1
- hey theree 2
- hey theree 3
- hey theree 4
- hey theree 5
fun main(args:Array<String>) { for (item in 0..6) { if (item % 2 ==0) {//if the no is divisible by 2 or multiple of 2 println(" $item is multiple of $item fizz") } else if(item%3==0) { println("buzz") } } }
- OUTPUT
- 0 is multiple of 0 fizz
- 2 is multiple of 2 fizz
- buzz
- 4 is multiple of 4 fizz
- 6 is multiple of 6 fizz
kotlin when using read line
fun main(args:Array<String>) { println("ENTER A NO BETWEEN 1 - 10") var enterno= readLine()!!.toInt() when(enterno) { 1-> println("WRONG NO 1") 2-> println("GET CLOSE 2") 3-> println("CLOSER 3" ) 4-> println("HMM 4 ") 5-> println("GOOD 5") else->{ println("sorry you lost") } } }
- OUTPUT
- ENTER A NO BETWEEN 1 - 10
- 2
- GET CLOSE 2
- Process finished with exit code 0
Search This Blog
Categories
Popular Posts
-
https://github.com/Enteleform/-RES-/blob/master/%5BLinks%5D/%5BAndroid%5D%20Udacity%20Curriculum.md#full-curriculum-outline Full Curri...
-
'C:\Users\viraj\AppData\Local\Android\sdk\platform-tools\adb.exe,start-server' failed -- run manually if necessary Solution ...
-
how to make crores from 1 lakh in stock markets in 1 year
Pages
Blog Archive
-
▼
2018
(76)
-
▼
July
(33)
- adb.exe,start-server' failed — run manually if nec...
- KOTLIN HELLO WORLD PROGRAM
- comment in kotline
- kotline variable
- kotline variable type string
- kotlin int type
- kotlin double variable type
- kotlin Boolean
- kotlin Float
- Kotlin char variable type
- val and var diffrence in kotlin
- kotlin read line method
- kotlin addition of two no
- kotlin substraction
- kotlin multiplication
- kotlin division
- kotline remainder
- kotline increament and decrement operator
- KOTLIN CONVERTING DATA TYPE
- kotlin conditional operator
- kotlin if else statement
- kotlin when
- kotlin when using read line
- kotlin for loop
- kotlin while loop
- kotlin do while loop
- best design android
- colour code
- Arti App
- intent data passing example
- read string value from resource
- share button android studio
- rate us button android code
-
▼
July
(33)
how to make crores from 1 lakh in stock markets in 1 year
how to make crores from 1 lakh in stock markets in 1 year