Back to project page faster-gps.
The source code is released under:
GNU General Public License
If you think the Android project faster-gps listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
/* * Copyright (C) 2012 Dominik Schrmann <dominik@dominikschuermann.de> */*from w w w . jav a 2s.co m*/ * This file is part of FasterGPS. * * FasterGPS is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * FasterGPS is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with FasterGPS. If not, see <http://www.gnu.org/licenses/>. * */ package org.fastergps.ui; import org.fastergps.BuildConfig; import org.fastergps.R; import android.content.Intent; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import org.sufficientlysecure.donations.DonationsFragment; public class HelpActivity extends FragmentActivity { /** * Google */ private static final String GOOGLE_PUBKEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAg8bTVFK5zIg4FGYkHKKQ/j/iGZQlXU0qkAv2BA6epOX1ihbMz78iD4SmViJlECHN8bKMHxouRNd9pkmQKxwEBHg5/xDC/PHmSCXFx/gcY/xa4etA1CSfXjcsS9i94n+j0gGYUg69rNkp+p/09nO9sgfRTAQppTxtgKaXwpfKe1A8oqmDUfOnPzsEAG6ogQL6Svo6ynYLVKIvRPPhXkq+fp6sJ5YVT5Hr356yCXlM++G56Pk8Z+tPzNjjvGSSs/MsYtgFaqhPCsnKhb55xHkc8GJ9haq8k3PSqwMSeJHnGiDq5lzdmsjdmGkWdQq2jIhKlhMZMm5VQWn0T59+xjjIIwIDAQAB"; private static final String[] GOOGLE_CATALOG = new String[] { "fastergps.donation.1", "fastergps.donation.2", "fastergps.donation.3", "fastergps.donation.5", "fastergps.donation.8", "fastergps.donation.13" }; /** * PayPal */ private static final String PAYPAL_USER = "dominik@dominikschuermann.de"; private static final String PAYPAL_CURRENCY_CODE = "EUR"; /** * Flattr */ private static final String FLATTR_PROJECT_URL = "http://code.google.com/p/faster-gps"; // without http:// ! private static final String FLATTR_URL = "flattr.com/thing/526077/FasterGPS"; /** * Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.help_activity); FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); DonationsFragment donationsFragment; if (BuildConfig.DONATIONS_GOOGLE) { donationsFragment = DonationsFragment.newInstance(BuildConfig.DEBUG, true, GOOGLE_PUBKEY, GOOGLE_CATALOG, getResources().getStringArray(R.array.help_donation_google_catalog_values), false, null, null, null, false, null, null); } else { donationsFragment = DonationsFragment.newInstance(BuildConfig.DEBUG, false, null, null, null, true, PAYPAL_USER, PAYPAL_CURRENCY_CODE, getString(R.string.help_donation_paypal_item), true, FLATTR_PROJECT_URL, FLATTR_URL); } ft.replace(R.id.help_donations_container, donationsFragment, "donationsFragment"); ft.commit(); } /** * Needed for Google Play In-app Billing. It uses startIntentSenderForResult(). The result is not propagated to * the Fragment like in startActivityForResult(). Thus we need to propagate manually to our Fragment. * * @param requestCode * @param resultCode * @param data */ @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); FragmentManager fragmentManager = getSupportFragmentManager(); Fragment fragment = fragmentManager.findFragmentByTag("donationsFragment"); if (fragment != null) { ((DonationsFragment) fragment).onActivityResult(requestCode, resultCode, data); } } }