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
| Thread.currentThread().getId(); |
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 javax.net.ssl.*; | |
| import java.io.*; | |
| import java.net.URL; | |
| import java.net.URLConnection; | |
| import java.net.URLEncoder; | |
| import java.security.GeneralSecurityException; | |
| import java.security.SecureRandom; | |
| import java.security.cert.X509Certificate; | |
| import java.util.HashMap; | |
| import java.util.Map; |
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
| @GetMapping(value = "/test") | |
| public void test(@RequestHeader HttpHeaders httpHeaders){ | |
| System.out.println("ALL headers -- "+ httpHeaders); | |
| System.out.println(httpHeaders.get("DEVICE-ID")); | |
| System.out.println(httpHeaders.get("DEVICE-ID").get(0)); | |
| // System.out.println("'Accept' header -- "+ headers.("Accept")); | |
| // System.out.println("'TestCookie' value -- "+ headers.getCookies().get("TestCookie").getValue()); | |
| } |
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
| mRecycler = findViewById(R.id.home_recycler); | |
| mRecycler.setHasFixedSize(true); | |
| mRecycler.setLayoutManager(new GridLayoutManager(this, 2)); | |
| mPager = findViewById(R.id.mainViewPager); | |
| WormDotsIndicator wormDotsIndicator = findViewById(R.id.worm_dots_indicator); | |
| categories = new ArrayList<>(); | |
| categories.add(new Category(R.drawable.cam, PHOTOGRAPHY)); | |
| categories.add(new Category(R.drawable.eve, EVENT)); |
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
| String apiKey = getString(R.string.api_key); | |
| /** | |
| * Initialize Places. For simplicity, the API key is hard-coded. In a production | |
| * environment we recommend using a secure mechanism to manage API keys. | |
| */ | |
| if (!Places.isInitialized()) { | |
| Places.initialize(getApplicationContext(), apiKey); | |
| } | |
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
| String apiKey = getString(R.string.api_key); | |
| /** | |
| * Initialize Places. For simplicity, the API key is hard-coded. In a production | |
| * environment we recommend using a secure mechanism to manage API keys. | |
| */ | |
| if (!Places.isInitialized()) { | |
| Places.initialize(getApplicationContext(), apiKey); | |
| } | |
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
| <fragment android:id="@+id/autocomplete_fragment" | |
| android:layout_width="match_parent" | |
| android:layout_height="wrap_content" | |
| android:name="com.google.android.libraries.places.widget.AutocompleteSupportFragment" | |
| /> |
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
| // Initialize the AutocompleteSupportFragment. | |
| AutocompleteSupportFragment autocompleteFragment = (AutocompleteSupportFragment) | |
| getSupportFragmentManager().findFragmentById(R.id.autocomplete_fragment); | |
| autocompleteFragment.setPlaceFields(Arrays.asList(Place.Field.ID, Place.Field.NAME)); | |
| autocompleteFragment.setOnPlaceSelectedListener(new PlaceSelectionListener() { | |
| @Override | |
| public void onPlaceSelected(Place place) { | |
| // TODO: Get info about the selected place. |
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 boolean onOptionsItemSelected(MenuItem item) { | |
| switch (item.getItemId()) { | |
| case R.id.search: | |
| onSearchCalled(); | |
| return true; | |
| case android.R.id.home: | |
| finish(); | |
| return true; | |
| default: |