This file contains 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
If you got the following error | |
$ ./gradlew assemble | |
A problem occurred configuring project ':app'. | |
> Could not resolve all dependencies for configuration ':app:_mockDebugCompile'. | |
> Could not resolve com.android.support:appcompat-v7:23.2.0. | |
Required by: | |
Ordify:app:unspecified | |
> Could not resolve com.android.support:appcompat-v7:23.2.0. |
This file contains 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"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> | |
... | |
<uses-permission android:name="android.permission.DISABLE_KEYGUARD"/> | |
<uses-permission android:name="android.permission.WAKE_LOCK"/> | |
... | |
</manifest> |
This file contains 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
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> | |
<uses-feature android:name="android.hardware.camera" | |
android:required="true" /> |
This file contains 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 | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
Button button = (Button) findViewById(R.id.button); | |
button.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
openDialog(); | |
} |
This file contains 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 void onResume() { | |
// Set the width of the dialog proportional to 90% of the screen width | |
Window window = getDialog().getWindow(); | |
Point size = new Point(); | |
Display display = window.getWindowManager().getDefaultDisplay(); | |
display.getSize(size); | |
window.setLayout((int) (size.x * 0.90), WindowManager.LayoutParams.WRAP_CONTENT); | |
window.setGravity(Gravity.CENTER); | |
super.onResume(); |
This file contains 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
Intent intent = new Intent(Intent.ACTION_VIEW); | |
Uri uri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_URI, String.valueOf(contactID)); | |
intent.setData(uri); | |
context.startActivity(intent); |
This file contains 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
-- TABLET -- | |
values-sw720dp 10.1” tablet 1280x800 mdpi | |
values-sw600dp 7.0” tablet 1024x600 mdpi | |
-- PHONE -- | |
values-sw480dp 5.4” 480x854 mdpi | |
values-sw480dp 5.1” 480x800 mdpi | |
values-xhdpi 4.7” 1280x720 xhdpi | |
values-xhdpi 4.65” 720x1280 xhdpi | |
values-hdpi 4.0” 480x800 hdpi |
This file contains 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 { | |
static { | |
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true); | |
} | |
... | |
} |
This file contains 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
//LOAD CSV script for GFTS data | |
create constraint on (a:Agency) assert a.id is unique; | |
create constraint on (r:Route) assert r.id is unique; | |
create constraint on (t:Trip) assert t.id is unique; | |
create index on :Trip(service_id); | |
create constraint on (s:Stop) assert s.id is unique; | |
create index on :Stoptime(stop_sequence); | |
create index on :Stop(name); | |
//add the agency |
This file contains 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 MyApp extends Application { | |
@Override | |
public void onCreate() { | |
super.onCreate(); | |
if (BuildConfig.DEBUG) { | |
Timber.plant(new Timber.DebugTree() { | |
@Override | |
protected String createStackElementTag(StackTraceElement element) { |
OlderNewer