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
October 2017
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 Blinklist  Social bookmarking Blogmarks  Social bookmarking Technorati  

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

 android studio walkthroughs

View previous topic View next topic Go down 
AuthorMessage
Moti Barski

avatar

Posts : 91
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
Back to top Go down
View user profile
Moti Barski

avatar

Posts : 91
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.
Back to top Go down
View user profile
 
android studio walkthroughs
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» Trulia's Android Tablet Sweepstakes
» Golden Amazo Vs Super Android 17
» Installing Android/ADB/fastboot Drivers on Windows 10 (Disable Driver Verification)
» How to hide apps on Android without root by PrivateMe
» Dr. Dre Beats Giveaway *usa only*

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