battle programmers alliance

battle programminga forum for elite programmerswith extreme will powerto sharpen theire skills
 
HomeCalendarFAQSearchMemberlistUsergroupsRegisterLog in
Search
 
 

Display results as :
 
Rechercher Advanced Search
Latest topics
» android mobile app dev APK
Sun Jul 15, 2018 6:20 pm by Moti Barski

» android studio execises
Mon Jul 09, 2018 1:43 pm by Moti Barski

» problem with firebase authentication
Thu Jun 28, 2018 9:52 am by Moti Barski

» text art canvas
Wed Jun 20, 2018 8:55 pm by Moti Barski

» links/suggestions to become a programmer
Mon May 07, 2018 11:01 pm by Moti Barski

» java eclipse oxygen grimoire
Thu May 03, 2018 8:24 pm by Moti Barski

» forum logo by tf monkey
Wed May 02, 2018 10:17 pm by Moti Barski

» java and MySQL
Mon Apr 30, 2018 3:02 pm by Admin

» mini A.I puzzles
Mon Apr 23, 2018 11:38 am by Moti Barski

July 2018
SunMonTueWedThuFriSat
1234567
891011121314
15161718192021
22232425262728
293031    
CalendarCalendar
Social bookmarking
Social bookmarking digg  Social bookmarking delicious  Social bookmarking reddit  Social bookmarking stumbleupon  Social bookmarking slashdot  Social bookmarking yahoo  Social bookmarking google  Social bookmarking blogmarks  Social bookmarking live      

Bookmark and share the address of battle programmers alliance on your social bookmarking website
Share | 
 

 android studio walkthroughs

Go down 
AuthorMessage
Moti Barski

avatar

Posts : 154
Join date : 2011-08-02

PostSubject: android studio walkthroughs   Sat Oct 14, 2017 1:56 pm

1 hello world
check if you got JDK : window flag, type add remove program, look for
java se development kit (64bit) if not go online search JDK download.
next DL and install :
android studio 64bit

open your mobil device for developing search the walkthrough for your phone.

in the now visible phone developer options (on your phone), enable usb debugging

in android studio (on your computer)
blank or empty activity

deploying an emulator : click the green arrow on the top toolbar, select your usb connected android phone


your activityname.xml tab, design tab, pallette tab, drag drop elements to the phone picture.
such as button, in the text tab now you can see code has been generated for the pallette
you can edit the code or copy paste change it to add palletes with text.
mark select the button, widgets, right click constraint layout, infer constraints

text (double click tab to go bigger screen)

Code:
 <Button
        android:id="@+id/button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:onClick="topClick"
        android:text="Button"
        tools:layout_constraintTop_creator="1"
        android:layout_marginStart="16dp"
        android:layout_marginTop="26dp"
        tools:layout_constraintLeft_creator="1"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        android:layout_marginLeft="394dp" />

    <Button
        android:id="@+id/button2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:onClick="buttomClick"
        android:text="Button2"
        tools:layout_constraintTop_creator="1"
        android:layout_marginStart="16dp"
        android:layout_marginTop="37dp"
        app:layout_constraintTop_toBottomOf="@+id/button"
        tools:layout_constraintLeft_creator="1"
        app:layout_constraintLeft_toLeftOf="parent"
        android:layout_marginLeft="16dp" />
in the button on click property type the methode name topClick for example
the java code methode name must match

the buttons need you to write methodes or they will crash the apk :

in the code view :
Code:
package com.example.lenovo.myapplication;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Toast;

public class helloworld extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_helloworld);
        Toast.makeText(this, "Can you see me", Toast.LENGTH_SHORT).show();
        Log.i("info", "Done creating the app");
    }
    public void topClick(View v){  Toast.makeText(this, "Top button clicked",      Toast.LENGTH_SHORT).show();  Log.i("info","The user clicked the top button"); }
    public void buttomClick(View v){  Toast.makeText(this, "Bottom button clicked",    Toast.LENGTH_SHORT).show();  Log.i("info","The user clicked the bottom button"); }
}

stand with mouse on error (red code) area,
Alt + Enter keyboard combination to import the View class and remove the errors

you will see the messages when you run the apk and click the btns. bounce

_________________
MB over and out
Back to top Go down
View user profile
Moti Barski

avatar

Posts : 154
Join date : 2011-08-02

PostSubject: 2 using the buttom monitor tab   Tue Oct 17, 2017 9:48 pm


code :
Code:
// = comment
// TODO: edit buy bananas
in the logcat todo, the above reminder will appear
Terminal: You can use this to navigate your OS and do anything you can do from a console (DOS) window.
• Messages: As the name suggests, you will get system and error messages in this window.

_________________
MB over and out
Back to top Go down
View user profile
 
android studio walkthroughs
Back to top 
Page 1 of 1
 Similar topics
-
» Trulia's Android Tablet Sweepstakes
» Golden Amazo Vs Super Android 17
» Dr. Dre Beats Giveaway *usa only*
» How to use ANT build to create HTML reports in Eclispe
» The Conduit heads to Android

Permissions in this forum:You cannot reply to topics in this forum
battle programmers alliance :: battle programming alliance :: battle programming-
Jump to: