This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:orientation="vertical" | |
android:padding="8dp"> | |
<LinearLayout | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class WordCursorAdapter extends CursorAdapter{ | |
Context context; | |
Cursor cursor; | |
public WordCursorAdapter(Context x, Cursor c){ | |
super(x, c,0); | |
this.context = x; | |
this.cursor = c; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.. | |
@Override | |
public View newView(Context context, Cursor cursor, ViewGroup viewGroup) { | |
return LayoutInflater.from(context).inflate(R.layout.word_item_layout, viewGroup, false); | |
} | |
@Override | |
public void bindView(View view, Context context, Cursor cursor) { | |
TextView t_word = view.findViewById(R.id.item_word); | |
TextView t_word_A = view.findViewById(R.id.item_word_a); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity extends AppCompatActivity { | |
Cursor cursor; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
// Define a projection that specifies which columns from the database | |
// you will actually use after this query. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity extends AppCompatActivity implements LoaderManager.LoaderCallbacks<Cursor> { | |
private static final int URL_LOADER = 0; | |
WordCursorAdapter mAdapter; | |
// Define a projection that specifies which columns from the database | |
// you will actually use after this query. | |
String[] projection = { | |
Words._ID, | |
Words.COLUMN_WORD, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main (){ | |
System.Out.println("Hello World") ; | |
sout("Test"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function welcom(){ | |
console.log("hi"); | |
} | |
welcom(); | |
------------------------ | |
var welcom = function (){ | |
console.log("hi"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
// we can call befor the defined | |
welcom(); | |
// once we defined the function we can call it where we want | |
function welcom(){ | |
console.log("hi"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const http = require('http'); | |
const hostname = '127.0.0.1'; | |
const port = 3000; | |
const server = http.createServer((req, res) => { | |
res.statusCode = 200; | |
res.setHeader('Content-Type', 'text/plain'); | |
res.end('Hello, World!\n'); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// we need this module to create the server and handel the request from the user | |
const http = require('http'); | |
// here is the host where the server will work | |
const hostname = '127.0.0.1'; | |
// you can use any port but the likely for node.js is 3000 | |
const port = 3000; | |
// here is a call back function we will talk about it later but this function called when the user requset the server URL | |
const server = http.createServer((req, res) => { |