[android-developers] Digest for android-developers@googlegroups.com - 16 Messages in 12 Topics

Group: http://groups.google.com/group/android-developers/topics

    android devloper <android.devloper45@gmail.com> May 30 11:24PM -0700  

    Hello all,
    i am getting the below error when signing the apk from command prompt
    using the ant builder,if anybody has idea please help me.
     
    D:\Android-Sdks\tools\ant\build.xml:1132: The following error occurred
    while executing this line:
    D:\Android-Sdks\tools\ant\build.xml:1144: Value for 'keystore' is not
    valid. It must resolve to a single path
     
     
    Thanks in advance.

     

    Yamusani Vinay <yamusanivinay@gmail.com> May 30 10:23PM -0700  

    How to apply bass boost to media player..

     

    Harish <hkachoria@gmail.com> May 30 08:21PM -0700  

    Dear friends,
     
    With gr8 help of this group, we developed one free app to view all events
    like birthdays, anniversary, reminders
    along with option of sending sms,
    I look forward your suggestions on this app. This is completely free
    without any ads and even without internet permission so don't worry abt any
    data theft or other misuse.
     
    https://play.google.com/store/apps/details?id=com.mexel.aapi
     
    and sorry abt posting a promotional post.

     

    Yamusani Vinay <yamusanivinay@gmail.com> May 30 07:43PM -0700  

    How to apply bass boost effect to media player

     

    Michael Asimos <michael.asimos@gmail.com> May 30 04:46PM -0700  

    Thanks!
    On Monday, May 27, 2013 10:23:05 AM UTC-7, Etienne wrote:

     

    Guillermo Andrades <lokoyaw@gmail.com> May 30 05:34AM -0700  

    Hi,
     
    I'm in the middle of the integration of GPGS on my game and I'm facing a
    problem.
     
    I have two scoreboards registered in the dashboard and I've sent some
    scores for one. I'm trying to get the scores for the current player in all
    the scoreboards.
     
    When calling the method loadPlayerCenteredScores<http://developer.android.com/reference/com/google/android/gms/games/GamesClient.html#loadPlayerCenteredScores(com.google.android.gms.games.leaderboard.OnLeaderboardScoresLoadedListener,
    java.lang.String, int, int, int)> it should give me the Leaderboard object
    (in the LeaderboardBuffer) and one LeaderboardScore object (in the
    LeaderboardScoreBuffer) but the LeaderboardScoreBuffer is empty instead.
    Code:
     
    gamesHelper.getGamesClient().loadPlayerCenteredScores(new
    OnLeaderboardScoresLoadedListener() {
    @Override
    public void onLeaderboardScoresLoaded(int arg0, LeaderboardBuffer arg1,
    LeaderboardScoreBuffer arg2) {
    System.out.println("Count1: " + arg1.getCount());
    System.out.println("Count2: " + arg2.getCount());
    for(LeaderboardScore jarl : arg2){
    System.out.println("This is never shown");
    }
    }
    }, localScore.id, LeaderboardVariant.TIME_SPAN_ALL_TIME,
    LeaderboardVariant.COLLECTION_PUBLIC, 1);
     
     
    The result:
     
    Count1: 1
    Count2: 0
     
     
    If I try to retrieve the data using the variants (getVariants()<http://developer.android.com/reference/com/google/android/gms/games/leaderboard/Leaderboard.html#getVariants()>)
    it works OK and I can retrieve the score for the current player. Code:
     
    Leaderboard serverScore = ...
    ArrayList<LeaderboardVariant> scoresVariant = serverScore.getVariants();
    for(LeaderboardVariant scoreVariant : scoresVariant){
    if(scoreVariant.getCollection() == LeaderboardVariant.COLLECTION_PUBLIC &&
    scoreVariant.getTimeSpan() == LeaderboardVariant.TIME_SPAN_ALL_TIME){
    System.out.println("Score: " + scoreVariant.getRawPlayerScore());
    }
    }
     
     
    Is there anything that I'm doing wrong?
     
    Greetings

     

    Guillermo Andrades <lokoyaw@gmail.com> May 30 02:53PM -0700  

    So how can I get the info in a reliable way?
     
    On Thursday, May 30, 2013 2:55:28 PM UTC+2, Paul-Peter Tournaris wrote:

     

    "Παύλος-Πέτρος Τουρνάρης" <p.tournaris@gmail.com> May 31 01:26AM +0300  

    Havent tried my way with GPGS yet, i will do it in Summer after exams so i
    am sorry that i can't answer you!
     
     
     
     
    --
    *Παύλος-Πέτρος Τουρνάρης*
    *Android & Software Developer*
     
    - *http://goo.gl/TsJ8u*
    - *http://acschedule.org*

     

    bjv <bjvetter@gmail.com> May 30 01:55PM -0700  

    Ok, it was a bad subject. I just needed a way to provide a Bitmap drawable
    in my App's memory (not on sdcard) to the SearchWidget suggestion handling
    code. Here's the answer for anyone who needs to provide their own image
    that isn't stored somewhere as a file and easily accessible via one of the
    other content providers that are already there.
     
    I created a ContentProvider in my app. The key methods look like the
    following:
     
    @Override
     
    public ParcelFileDescriptor openFile(Uri uri, String mode)
     
    throws FileNotFoundException {
     
    ParcelFileDescriptor[] pipe=null;
     
     
    try {
     
    pipe=ParcelFileDescriptor.createPipe();
     
    String bmapId = uri.getLastPathSegment();
     
    IconInfo ai = getIconInfo.lookup(Integer.parseInt(bmapId));
     
    if (ai == null)
     
    throw new FileNotFoundException("Bitmap "+bmapId+" not found");
     
    Bitmap bitmap = ((BitmapDrawable)ai.icon).getBitmap();
     
    if (bitmap == null)
     
    throw new FileNotFoundException("Drawable is not Bitmap");
     
    // The following task/thread is needed if the bmap is larger than 64kb
     
    new BitmapCopyTask(bitmap,
     
    new AutoCloseOutputStream(pipe[1])).execute(null,null
    ,null);
     
    }
     
    catch (IOException e) {
     
    MyLog.d(getClass().getSimpleName(), "Exception opening pipe: %s",
    e.getMessage());
     
    throw new FileNotFoundException("Could not open pipe for: "
     
    + uri.toString());
     
    }
     
     
    return(pipe[0]);
     
    }
     
     
    class BitmapCopyTask extends AsyncTask<Void,Void,Void> {
     
    OutputStream out;
     
    Bitmap bmap;
     
    BitmapCopyThread(Bitmap bmap, OutputStream out) {
     
    this.bmap = bmap;
     
    this.out = out;
     
    }
     
    @Override
     
    protected Void doInBackground(Void... arg0) {
     
    bmap.compress(Bitmap.CompressFormat.PNG, 100, out);
     
    return null;
     
    }
     
    }
     
    I also put the following provider definition in my manifest file:
     
    <provider android:name=".IconProvider"
     
    android:exported="false"
     
    android:authorities="org.example.provider.iconlist.icon" />

     

    Lew <lewbloch@gmail.com> May 30 02:55PM -0700  

    bjv wrote:
     
     
    > public ParcelFileDescriptor openFile(Uri uri, String mode)
     
    > throws FileNotFoundException {
     
    > ParcelFileDescriptor[] pipe=null;
     
    No need for this assignment as you throw away the value immediately
    without using it.
     
     
     
    > IconInfo ai = getIconInfo.lookup(Integer.parseInt(bmapId));
     
    > if (ai == null)
     
    > throw new FileNotFoundException("Bitmap "+bmapId+" not found");
     
    Don't omit the curly braces!

     
     
    > new BitmapCopyTask(bitmap,
     
    > new AutoCloseOutputStream(pipe[1])).execute(null,
    > null,null);
     
    Do not indent your posted code with TAB characters.

     
    > e.getMessage());
     
    > throw new FileNotFoundException("Could not open pipe for: "
     
    > + uri.toString());
     
    You should include the original exception as a cause of your wrapped
    exception, which normally is already
    a 'FileNotFoundException', so one wonders why you'd wrap a FNFE inside an
    FNFE.

     
     
    > }
     
    > class BitmapCopyTask extends AsyncTask<Void,Void,Void> {
     
    > OutputStream out;
     
    Consider making these members 'final'.

     
     
    > @Override
     
    > protected Void doInBackground(Void... arg0) {
     
    > bmap.compress(Bitmap.CompressFormat.PNG, 100, out);
     
    You didn't check the arguments for 'null'.

     
     
    --
    Lew

     

    Miha <miha.valencic@gmail.com> May 30 05:47AM -0700  

    Hi everybody!
     
    On Wednesday, May 29, 2013 9:35:49 PM UTC+2, Miha wrote:
     
    > I'll post the whole mechanics tomorrow.
     
    So, to give some context: I'm using a ViewPager with
    FragmentStatePageAdapter, where I have three fragments. Two of those
    fragments (first and third), also nest another fragments inside. The first
    one has a two-pane layout, and the third one is sort of a file-browser
    where three types of fragments change (computer, shares, files).
     
    We know that when we derive our activity, the BACK key is handled for us
    automatically by the FragmentActivity base class. This is of course not the
    case for nested fragments, where I need to "clear the backstack"
    appropriately. So for that, I've defined and implemented a simple interface:
     
    public interface BackButtonPressListener {
    boolean onBackButtonPressed();
    }
     
    I use this interface from the main Activity, which implements this
    interface. So when a Back key is pressed, I get the current fragmet from
    FragmentStatePageAdapter, and call onBackButtonPressed on that fragment. If
    this fragment is able to "pop" the back-stack, I leave it at that. If not,
    I let the base activity handle the key press.
     
    I had the problem with FragmentStatePageAdapter, more so with its
    getItem(int) method. I was under the impression that this method would get
    the current fragment, but it is actually intended to **create** fragments;
    FragmentStatePageAdapter internally caches those instances for viewPager,
    so I went about implementing my own cache for that as well (since
    FragmentStatePageAdapter's cache is private). I overrode the method
    instantiateItem with such implementation:
     
    public Object instantiateItem(ViewGroup container, int position) {
    Object item = super.instantiateItem(container, position);
    _items.put(position, item);
    return item;
    }
     
    where _items is a private member of type SparseArray<Fragment>.
     
    I added a simple method to get the reference to the current fragment being
    shown inside a ViewPager to my page adapter:
    public Fragment getCreatedItem(int position)
    {
    Object item = _items.get(position, null);
    if (item != null)
    {
    return (Fragment) item;
    }
    Log.v(TAG, _items.toString());
    throw new RuntimeException("No matching item in an inner array or item
    is null..."); // shouldn't happen
    }
     
    The "onBackButtonPressed" in the "main" (top-level) fragments handler
    implementation is very simple as well:
    @Override
    public boolean onBackButtonPressed() {
    try {
    return FragmentManager fragmentManager =
    getChildFragmentManager().popBackStackImmediate();
    } catch (Exception x) {
    Log.e(TAG, "Could not pop back stack!", x);
    }
    return false;
    }
     
    All of my fragments implement onSaveInstanceState to store state and so
    far, everything works as expected (screen orientation changes, resuming an
    app, back presses).
     
    I hope this helps someone as well, given some misleading information out
    there.
     
    Regards,
    Miha.

     

    Fran <fmmarzoa@gmail.com> May 30 03:42AM -0700  

    Hi!
     
    I am trying to use the Google Plus sign in/out buttons in my own "Settings"
    activity within my app, but I have found no way to do it. I tried cutting
    and pasting the button from the example app layout to my own activity
    layout, but it raises the following error:
     
    com.google.android.gms.common.SignInButton failed to instantiate.
     
    Then, I tried to import such thing from my Settings Activity class, right
    like:
     
    import com.google.android.gms.common.SignInButton;
     
    and even:
     
    com.google.android.gms.common.*;
     
    also, but the same *failed to instantiate* error persists after that.
     
    So, any ideas?
     
    I know I could simply duplicate all these resources in my own app, but as
    far as the example app does not do that, there should be a better way...
     
    Bests,

     

    Piren <gpiren@gmail.com> May 30 02:10AM -0700  

    3.0. it in the release notes
     
    On Wednesday, May 29, 2013 9:05:31 PM UTC+3, RichardC wrote:

     

You received this message because you are subscribed to the Google Group android-developers.
You can post via email.
To unsubscribe from this group, send an empty message.
For more options, visit this group.

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment