some useful plugins that i usually use with android studio.
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
| version: 2 | |
| jobs: | |
| build: | |
| working_directory: ~/code | |
| docker: | |
| - image: circleci/android:api-25-alpha | |
| environment: | |
| JVM_OPTS: -Xmx3200m | |
| steps: | |
| - checkout |
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
| #!/bin/bash | |
| echo -e "yes\nusername\npassword" | sudo openconnect connectionUrl |
Add this snippet to intelijIdea Copyright profiles, and Then select it as your project default Copyright, Then update copyright of all files of your project.
Copyright Notice: Settings-> Editor-> Copyright-> Copyright Profiles
Copyright $today.year $user.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
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 Person implements Serializable { | |
| private static final long serialVersionUID = 1L; | |
| static String country = "IRAN"; | |
| private int age; | |
| private String name; | |
| //getter & setters | |
| } |
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
| Person person = new Person(); | |
| person.setAge(22); | |
| person.setName("Ali"); | |
| //write serializable object | |
| FileOutputStream fileOutputStream = new FileOutputStream("file.txt"); | |
| ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream); | |
| objectOutputStream.writeObject(person); | |
| objectOutputStream.flush(); | |
| objectOutputStream.close(); |
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
| import android.os.Parcel; | |
| import android.os.Parcelable; | |
| public class ParcelablePerson implements Parcelable { | |
| public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { | |
| public ParcelablePerson createFromParcel(Parcel in) { | |
| return new ParcelablePerson(in); | |
| } |
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
| //writing a Parcelable | |
| intent.putExtra("person", new ParcelablePerson("Ali",22)); | |
| //reading a Parcelable | |
| Bundle data = getIntent().getExtras(); | |
| ParcelablePerson person = (ParcelablePerson) data.getParcelable("person"); |
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
| class Text { | |
| String text; | |
| String author; | |
| int length; | |
| String getText() { ... } | |
| void setText(String s) { ... } | |
| String getAuthor() { ... } | |
| void setAuthor(String s) { ... } |