Olivier Margarit | 26 Mar 15:36 2015
Picon

gradle 1.1.x + aar lib = issues

Hi,

I'm working on nice corporate library.
The distribution is, at this time, done by integration of an .aar file added as a new module with android studio.
This was working until gradle 1.1.x

What is working: The project compile as the project has no error.
What is broken: Android Studio does not recognize all classes provided by the librairie like these doesn't exist.

But I insist on the fact that the project is compiling and the library do what it should do!

No configuration have change but the gradle version updgraded from 1.0.1 to 1.1.0.

I have noticed that the dependance reference in the iml file have change from:
<orderEntry type="library" exported="" name="MyAwsomeLib-1.0.3-unspecified" level="project" />
to:
<orderEntry type="module" module-name="MyAwsomeLib-1.0.3" exported="" />

Is there a generic error that I am doing or is there a bug in gradle 1.1.x

Regards,

Olivier

--
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 <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> 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 <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
prudhvi p n v | 25 Mar 23:13 2015
Picon

Frame Layout issue

Hi Guys , 

     I am working on material design navigation drawer using support libraries . On the Main page of the navigation browser , I am trying to display Image, Image caption , Image description .  

   I am using three framelayouts inside of linearlayout with "weightsum"  to embed  each of the Image, Image caption , Image description.Below is the  error output  displayed  by adding gap after image




Here is the XML of the layout image

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">

<include
android:id=" <at> +id/toolbar_actionbar"
layout=" <at> layout/toolbar_default"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

<android.support.v4.widget.DrawerLayout
android:id=" <at> +id/drawer"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below=" <at> +id/toolbar_actionbar">

<FrameLayout
android:id=" <at> +id/container"
android:layout_width="match_parent"
android:clickable="true"
android:layout_height="match_parent" />

<!-- android:layout_marginTop="?android:attr/actionBarSize"-->
<fragment
android:id=" <at> +id/fragment_drawer"
android:name="com.poliveira.apps.materialtests.NavigationDrawerFragment"
android:layout_width=" <at> dimen/navigation_drawer_width"
android:layout_height="match_parent"
android:layout_gravity="start"
app:layout=" <at> layout/fragment_navigation_drawer" />


<LinearLayout
android:layout_below=" <at> +id/toolbar_actionbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id=" <at> +id/DataDisplay"
android:weightSum="100"
android:orientation="vertical">


<FrameLayout
android:id=" <at> +id/ImageFrame"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_weight="50">

<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id=" <at> +id/imageView"
android:layout_gravity="fill"
android:scaleType="fitStart"
android:src=" <at> drawable/hower_house" />
</FrameLayout>

<FrameLayout
android:requiresFadingEdge="horizontal"
android:layout_weight="10"
android:id=" <at> +id/ImageName"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layoutMode="clipBounds"
android:layout_gravity="left|start">

<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:theme=" <at> style/Base.TextAppearance.AppCompat.Caption"
android:text="Image Name"
android:textColor="#000000"
android:textSize="25sp"
android:scaleType="fitStart"
android:id=" <at> +id/ImageNameTextview" />
</FrameLayout>


<FrameLayout
android:id=" <at> +id/TextFrame"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="40"
android:layout_gravity="start"
android:paddingTop="10dp">


<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id=" <at> +id/scrollView">


<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Image Description"
android:id=" <at> +id/ImageDescTextview"
android:textColor="#000000"
android:paddingTop="20dp"
android:scaleType="fitStart"
android:layout_gravity="left|start" />

</ScrollView>

</FrameLayout>


</LinearLayout>


</android.support.v4.widget.DrawerLayout>


</RelativeLayout>

--
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 <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> 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 <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Dan Cha | 25 Mar 15:39 2015
Picon

Using the picasso image loader within custom adapter and works for only the first image, what am i doing wrong?

So after more testing and playing around i was able to figure out where to place the code, since it would work with the URL returned from the web service.

Placed it within my adapter, but it only loads the first image for the first record. From the examples ive found online, i believe it to be within the view logic in the adapter, but not sure and not sure where to change it.

Here is the entire adapter and what works for the first image/record only, the rest never show up a image, no matter how long i leave the app open.

Can anyone tell me if you see anything wrong with how i implemented the image loader?

public class CustomListView extends ArrayAdapter<InventoryItem>
{
    Activity context;
    int layoutResourceId;
    InventoryItem items[] = null;

    public CustomListView(Activity context,int layoutResourceId,InventoryItem[] items)
    {
        super(context, layoutResourceId, items);
        this.context = context;
        this.layoutResourceId = layoutResourceId;
        this.items = items;
    }

    <at> Override
    public View getView(int position, View view, ViewGroup parent)
    {
        View row = view;
        ItemsHolder holder = null;

        if(row == null)
        {
            LayoutInflater inflater =((Activity)context).getLayoutInflater();
            row = inflater.inflate(layoutResourceId, parent, false);

            holder = new ItemsHolder();
            holder.imgItem = ((ImageView)row.findViewById(R.id.tvImageValue));
            holder.txtCategory = (TextView)row.findViewById(R.id.tvCategoryValue);
            holder.txtDescription = (TextView)row.findViewById(R.id.tvDescriptionValue);
            holder.txtOwner = (TextView)row.findViewById(R.id.tvOwnerValue);
            holder.txtQty = (TextView)row.findViewById(R.id.tvQuantityValue);
            row.setTag(holder);
        }
        else
        {
            holder = (ItemsHolder)row.getTag();
        }

        InventoryItem item = items[position];
        holder.txtQty.setText(item.Count);
        holder.txtDescription.setText(item.Description);
        holder.txtCategory.setText(item.Category);

        Picasso.with(context)
                .load(item.Image)
                .into(holder.imgItem);

        holder.txtOwner.setText(item.Owner);
        return row;
    }

    static class ItemsHolder
    {
        ImageView imgItem;
        TextView txtCategory;
        TextView txtDescription;
        TextView txtOwner;
        TextView txtQty;
    }
}

--
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 <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> 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 <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
AJ | 25 Mar 06:39 2015
Picon

Android Accessories - parallel read/write

Hi,

I have been exploring on developing an Android accessory, but I have a basic doubt before I conclude it is feasible or not.

The UsbManager class has a openAccessory API, which returns a ParcelFileDescriptor instance. The ParcelFileDescriptor instance is used to create one instance each of FileInputStream and FileOutputStream. Does this mean all the read and write operations have to be sequential? Is there a way to do parallel read/write operations? In other words, how many endpoints are available to communicate with Android accessory?

Thank you,
Ajay

--
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 <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> 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 <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Psy Khé | 25 Mar 01:45 2015
Picon

[android-developers] [OFF] Site de Charges – Tirinhas – CT6

Senhores,

Venho apresentar meu Recente Site – Protótipo (CT 6 – We Will See – Take Notice),

Acesse: http://bit.ly/ct6-istgroup

O qual tem por Finalidade Agregar – Mostrar - Charges e Tirinhas de vários sites de terceiros.

Para quem curte esse tipo de conteúdo é interessante passar por lá, e conferir todo os dias as novas Charges e Tirinhas disponíveis.

Qualquer dúvida, sugestão, ou forma de contribuir com o projeto, pode ser enviado e-mail para:

admin <at> istgroup.com.br

Confere lá!

Agradecido!

Abraços,

Psy Khé aka Saulo – By IST 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 <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> 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 <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Rushyang Darji | 24 Mar 14:37 2015
Picon

Hi, have you tried LensKart? I just did!

TRY LENSKART... IT'S AWESOME!!
Hi,
I just got my spectacles from Lenskart. I'm pretty satisfied. You must try them too!
And get Rs. 1000 Off on your 1st purchase by using this special code at checkout:
Rs. 1000 Discount Code* - RUSHQ46O


VISIT  LENSKART 
 
*Min. buying value should be Rs. 1500 for the coupon application. *NA on Contact Lenses 
Follow -
Helpline (24X7) - (0)9999899998
Email -
  You received this mail because you are registered with Lenskart.
If you do not wish to receive any further communications, please click here.
 

--
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 <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> 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 <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Dan Cha | 23 Mar 22:50 2015
Picon

Unfortunately App has stopped is the error im getting and not sure why, all breakpoints make it thru no problem and then the message.

So i got past some of the earlier issues and changed my pages around to work with actual data being returned from the webservice.

Everything is returned, populated and as i step thru the code, everything i expect is there.. except when it gets to this line:
list.setAdapter(adapter);


From what i can tell it has something to due with the view within its own thread??
If that is true, what can i look for to correct?

Here is my custom adapter code:

public class CustomListView extends ArrayAdapter<InventoryItem>
{
    Activity context;
    int layoutResourceId;
    InventoryItem items[] = null;

    public CustomListView(Activity context,int layoutResourceId,InventoryItem[] items)
    {
        super(context, layoutResourceId, items);
        this.context = context;
        this.layoutResourceId = layoutResourceId;
        this.items = items;
    }

    <at> Override
    public View getView(int position, View view, ViewGroup parent)
    {
        View row = view;
        ItemsHolder holder = null;

        if(row == null)
        {
            LayoutInflater inflater = context.getLayoutInflater();
            row = inflater.inflate(R.layout.activity_view_listview_single, null, true);

            holder = new ItemsHolder();
            holder.imgItem = ((ImageView)row.findViewById(R.id.tvImageValue));
            holder.txtCategory = (TextView)row.findViewById(R.id.tvCategoryValue);
            holder.txtDescription = (TextView)row.findViewById(R.id.tvDescriptionValue);
            holder.txtOwner = (TextView)row.findViewById(R.id.tvOwnerValue);
            holder.txtQty = (TextView)row.findViewById(R.id.tvQuantityValue);
        }
        else
        {
            holder = (ItemsHolder)row.getTag();
        }

        InventoryItem item = items[position];
        return row;
    }

    static class ItemsHolder
    {
        ImageView imgItem;
        TextView txtCategory;
        TextView txtDescription;
        TextView txtOwner;
        TextView txtQty;
    }
}
=================================
Here is my asynctask code:

private class ItemTask extends AsyncTask<Void,Void,Void>
{
private final ProgressDialog dialog = new ProgressDialog(ViewInventoryActivity.this);
protected void onPreExecute(){
this.dialog.setMessage("Returning Item List...");
this.dialog.show();
}
protected Void doInBackground(final Void... unused)
        {
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()            
    .detectDiskReads()            
    .detectDiskWrites()            
    .detectNetwork()           
    .penaltyLog()            
    .build());
            
SoapObject request = new SoapObject(WSDL_TARGET_NAMESPACE,METHOD_NAME);
       SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
                   
       envelope.dotNet = true;
       envelope.setOutputSoapObject(request);
       
       HttpTransportSE httpTransport = new HttpTransportSE(URL);                       
       
       try
       {        
        List<HeaderProperty> invHeaders = new LinkedList<HeaderProperty>();
        httpTransport.call(SOAP_ACTION, envelope, (List<HeaderProperty>)invHeaders);
        SoapObject response = (SoapObject)envelope.bodyIn;
       
          if(response != null)
          {  
          SoapObject dataset = (SoapObject) response.getProperty(0);                    
          SoapObject table = (SoapObject) dataset.getProperty("diffgram");
          SoapObject dar = (SoapObject) table.getProperty("NewDataSet");
          Integer recCount = dar.getPropertyCount();
          items = new InventoryItem[recCount];
          for (int i=0;i<recCount;i++)
        {
          SoapObject suvas = (SoapObject) dar.getProperty(i);
          if (suvas != null)
          {
          String c;
          String d;
          String o;
          String img;
          String q;
          c = suvas.getPropertySafelyAsString("Category").toString();
          d = suvas.getPropertySafelyAsString("Description").toString();
          o = suvas.getPropertySafelyAsString("Owned_x0020_By").toString();
          img = suvas.getPropertySafelyAsString("Picture").toString();
          q = suvas.getPropertySafelyAsString("Qty","null").toString();
         
          items[i] = new InventoryItem(c, d, o, img, q);
          }
        }
          }
       }
       catch (Exception exception)
       {
        textViewStatus.setText(exception.toString());
       }

            CustomListView adapter = null;
            adapter = new CustomListView(ViewInventoryActivity.this,R.layout.activity_view_listview_single,items);
            list = (ListView)findViewById(R.id.list);
            list.setAdapter(adapter);
            return null;
}

protected void onPostExecute(Void result){
if(this.dialog.isShowing()){
this.dialog.dismiss();
}
}
}

=====================================
And here is my OnCreate code:

protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
                setContentView(R.layout.activity_view_listview_display);
find_and_modify_text_view();
                new ItemTask().execute();
}

=====================================
And here is the error i was finally able to see:

03-23 16:43:24.416  13243-13243/com.InventoryList.inventory E/dalvikvm﹕ >>>>> com.InventoryList.inventory [ userId:0 | appId:10248 ]
03-23 16:43:24.416  13243-13243/com.InventoryList.inventory E/SELinux﹕ [DEBUG] get_category: variable seinfocat: default sensitivity: NULL, cateogry: NULL
03-23 16:43:24.486      332-822/? E/audio_hw_primary﹕ adev_close_input_stream, set jack_in to null
03-23 16:43:29.366     974-1082/? E/ViewRootImpl﹕ sendUserActionEvent() mView == null
03-23 16:43:29.526  13243-13243/com.InventoryList.inventory E/MoreInfoHPW_View﹕ Parent view is not a TextView
03-23 16:43:45.946     974-1368/? E/Watchdog﹕ ! <at> Sync 7963
03-23 16:43:46.136  13243-13243/com.InventoryList.inventory E/MoreInfoHPW_View﹕ Parent view is not a TextView
03-23 16:44:00.026    3081-3081/? E/accuweather﹕ [KK AccuPhone]>>> UIM:1466 [0:0] bTM 4 44
03-23 16:44:04.496  13243-13263/com.InventoryList.inventory E/AndroidRuntime﹕ FATAL EXCEPTION: AsyncTask #1
    Process: com.InventoryList.inventory, PID: 13243
    java.lang.RuntimeException: An error occured while executing doInBackground()
            at android.os.AsyncTask$3.done(AsyncTask.java:300)
            at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
            at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
            at java.util.concurrent.FutureTask.run(FutureTask.java:242)
            at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
            at java.lang.Thread.run(Thread.java:841)
     Caused by: android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
            at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:7249)
            at android.view.ViewRootImpl.focusableViewAvailable(ViewRootImpl.java:3384)
            at android.view.ViewGroup.focusableViewAvailable(ViewGroup.java:661)
            at android.view.ViewGroup.focusableViewAvailable(ViewGroup.java:661)
            at android.view.ViewGroup.focusableViewAvailable(ViewGroup.java:661)
            at android.view.ViewGroup.focusableViewAvailable(ViewGroup.java:661)
            at android.view.View.setFlags(View.java:9841)
            at android.view.View.setFocusableInTouchMode(View.java:6486)
            at android.widget.AdapterView.checkFocus(AdapterView.java:891)
            at android.widget.ListView.setAdapter(ListView.java:493)
            at com.InventoryList.inventory.ViewInventoryActivity$ItemTask.doInBackground(ViewInventoryActivity.java:149)
            at com.InventoryList.inventory.ViewInventoryActivity$ItemTask.doInBackground(ViewInventoryActivity.java:81)
            at android.os.AsyncTask$2.call(AsyncTask.java:288)
            at java.util.concurrent.FutureTask.run(FutureTask.java:237)
            at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
            at java.lang.Thread.run(Thread.java:841)
03-23 16:44:04.856    974-13271/? E/android.os.Debug﹕ ! <at> Dumpstate > sdumpstate -k -t -z -d -o /data/log/dumpstate_app_error
03-23 16:44:05.036  13243-13243/com.InventoryList.inventory E/WindowManager﹕ android.view.WindowLeaked: Activity com.InventoryList.inventory.ViewInventoryActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView{434ddb90 V.E..... R......D 0,0-1415,384} that was originally added here
            at android.view.ViewRootImpl.<init>(ViewRootImpl.java:480)
            at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:267)
            at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
            at android.app.Dialog.show(Dialog.java:301)
            at com.InventoryList.inventory.ViewInventoryActivity$ItemTask.onPreExecute(ViewInventoryActivity.java:87)
            at android.os.AsyncTask.executeOnExecutor(AsyncTask.java:587)
            at android.os.AsyncTask.execute(AsyncTask.java:535)
            at com.InventoryList.inventory.ViewInventoryActivity.onCreate(ViewInventoryActivity.java:46)
            at android.app.Activity.performCreate(Activity.java:5600)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2504)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2599)
            at android.app.ActivityThread.access$900(ActivityThread.java:174)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:146)
            at android.app.ActivityThread.main(ActivityThread.java:5748)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
            at dalvik.system.NativeStart.main(Native Method)
03-23 16:44:15.946     974-1368/? E/Watchdog﹕ ! <at> Sync 7964

--
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 <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> 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 <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
NewToAndroid | 23 Mar 17:03 2015
Picon

Is it internet connection issue ?


Hi all,

I am developing a live audio streaming app on Android Studio 1.0.1 and testing it on Samsung Galaxy s3 phone
(not on emulator).

First I was getting IOException when i was doing setDataSource on media player object when using http://
url. I have set the INTERNET permission in manifest, still the issue was there (with different
implementations of setDataSource).

Then I found out that, I need to have Access_network_state set in manifest. The moment I set that in
manifest, I started getting error "neither the user nor current process has access network state  permission".
I have tried writting  access_network_state twice in the manifest (as suggested by few google search) and
also, I have tried doing clean and build of the project.
Still getting the error "neither user nor process has access_network_state " error.

Is this a permission setup issue ?? 
when I am deploying the app from my laptop to the phone over a usb cable, is it not setting up the network access
permissions ?
After an app is installed on my phone, how can I check, what permissions does the app have ??

I am thinking that, either on android studio or in my phone, I might have to do some settings so that, the
permissions are actually given to the app while/after deployment.

Please help. I am on the verge of giving up ....

Thanks in advance.

--

-- 
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 <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> 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 <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
BeEnder | 22 Mar 20:55 2015

Google Play Games Service onConnect Bundle is null

Hello community,

i want to create a turn based android game using the google play games service. The registered connection callback is called successfully, but the given Bundle is always null.
public void onConnected(Bundle connectionHint)

I have created the Google API Client with access to Plus and Games:
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.addApi(Plus.API).addScope(Plus.SCOPE_PLUS_LOGIN)
.addApi(Games.API).addScope(Games.SCOPE_GAMES)
.build();

Furthermore i have enabled the turn based multiplayer support on the Google Play Developer Console.

Thank you for your help

greetings

--
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 <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> 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 <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
israa mahmood | 22 Mar 18:05 2015
Picon

Full duplex voice transmission

hi 
i am creating a full duplex voice transmission using udp protocol but i get a lot of noise and echo and delay if you could help me i would be greatful
package com.example.israa.modified_call;

import android.media.AudioFormat;
import android.media.AudioManager;
import android.media.AudioRecord;
import android.media.AudioTrack;
import android.media.MediaRecorder;
import android.os.AsyncTask;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.SocketException;
import java.net.UnknownHostException;
import java.util.Arrays;


public class MainActivity extends ActionBarActivity {
    private EditText ip;
    private TextView streamingLabel;
    private Button Call,Answer,End;

   // public byte[] buffer;
    public static DatagramSocket socket;
    private int sendingport=50005;
    private int recievingport=50006;//which port??
    AudioRecord recorder;

    //Audio Configuration.
    private int sampleRate = 11025 ;      //How much will be ideal?
    private int channelConfig = AudioFormat.CHANNEL_CONFIGURATION_MONO;
    private int audioFormat = AudioFormat.ENCODING_PCM_16BIT;
    AudioTrack speaker;
    private boolean status = true;
    <at> Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ip = (EditText) findViewById (R.id.editText);
        streamingLabel = (TextView) findViewById(R.id.textView);
        Call = (Button) findViewById (R.id.button);
        Answer = (Button) findViewById (R.id.button2);
        End = (Button) findViewById (R.id.button3);

        streamingLabel.setText("Press Start! to begin");

        Call.setOnClickListener (startListener);
        End.setOnClickListener (stopListener);
        Answer.setOnClickListener(receiveListener);
    }

    private final View.OnClickListener stopListener = new View.OnClickListener() {

        <at> Override
        public void onClick(View arg0) {
            status = false;
            recorder.release();
            Log.d("VS", "Recorder released");
        }

    };
    private final View.OnClickListener receiveListener = new View.OnClickListener() {

        <at> Override
        public void onClick(View arg0) {
            status = true;
           Log.d("Note","RecordAudio");
            startReceiving();
         RecordAudio t=new RecordAudio();
            t.execute();
        }

    };

    private final View.OnClickListener startListener = new View.OnClickListener() {

        <at> Override
        public void onClick(View arg0) {
            status = true;
            startStreaming();
            PlayAudio a=new PlayAudio();
            a.execute();

        }

    };

    public void startStreaming() {


        Thread streamThread = new Thread(new Runnable() {

            <at> Override
            public void run() {
                try {


                    int minBufSize = AudioRecord.getMinBufferSize(sampleRate, channelConfig, audioFormat);
                    DatagramSocket socket = new DatagramSocket();
                    Log.d("VS", "Socket Created");
                    byte[] buffer = new byte[minBufSize*10];

                    Log.d("VS","Buffer created of size " + minBufSize);
                    DatagramPacket packet;

                    final InetAddress destination = InetAddress.getByName(ip.getText().toString());
                    Log.d("VS", "Address retrieved");


                    recorder = new AudioRecord(MediaRecorder.AudioSource.MIC,sampleRate,channelConfig,audioFormat,minBufSize);
                    Log.d("VS", "Recorder initialized");
                    //  speaker = new AudioTrack(AudioManager.STREAM_MUSIC,sampleRate,channelConfig,audioFormat,(minBufSize*10),AudioTrack.MODE_STREAM);



                    recorder.startRecording();
                    // speaker.play();

                    while(status == true) {


                        //reading data from MIC into buffer
                        minBufSize = recorder.read(buffer, 0, buffer.length);
                        Log.d("VS", "Reading");
                        //putting buffer in the packet
                        packet = new DatagramPacket (buffer,buffer.length,destination,sendingport);
                        Log.d("VS", "creating packet");
                        //   speaker.write(buffer, 0, minBufSize);
                        socket.send(packet);
                        //Arrays.fill(buffer, Byte.parseByte(null));

                    }



                } catch(UnknownHostException e) {
                    Log.e("VS", "UnknownHostException");
                }
                catch (Throwable t) {
                    Log.e("AudioTrack", "Playback Failed");
                }
           /*    catch (IOException e) {
                Log.e("VS", "IOException");
               }*/


            }

        });
        streamThread.start();
    }
    private class PlayAudio extends AsyncTask<Void, Integer, Void> {
        <at> Override
        protected Void doInBackground(Void... params) {

                try {

                    DatagramSocket recievingsocket = new DatagramSocket(recievingport);
                    Log.d("VR", "Socket Created");

                    int minBufSize1 = AudioTrack.getMinBufferSize(sampleRate, channelConfig, audioFormat);

                    byte[] buffer1 = new byte[minBufSize1*10];


                    //minimum buffer size. need to be careful. might cause problems. try setting manually if any problems faced
                    //  int minBufSize = AudioTrack.getMinBufferSize(sampleRate, channelConfig, audioFormat);

                    speaker = new AudioTrack(AudioManager.STREAM_MUSIC,sampleRate,channelConfig,audioFormat,(minBufSize1*10),AudioTrack.MODE_STREAM);

                    speaker.play();
                   while(status == true) {
                        try {


                            DatagramPacket packet1 = new DatagramPacket(buffer1,buffer1.length);
                            recievingsocket.receive(packet1);
                            Log.d("VR", "Packet Received");

                            //reading content from packet
                            buffer1=packet1.getData();
                            Log.d("VR", "Packet data read into buffer");

                            //sending data to the Audiotrack obj i.e. speaker
                            speaker.write(buffer1, 0, minBufSize1);
                            Log.d("VR", "Writing buffer content to speaker");
                         //   Arrays.fill(buffer1, Byte.parseByte(null));
                        } catch(IOException e) {
                            Log.e("VR","IOException");
                        }
                        catch(Throwable t){
                            Log.e("AudioTrack", "Playback Failed");
                        }
                    }


                } catch (SocketException e) {
                    Log.e("VR", "SocketException"+e.getMessage());
                }

                return null;
            }

    }

    public void startReceiving() {

        Thread receiveThread = new Thread (new Runnable() {

            <at> Override
            public void run() {

                try {

                    DatagramSocket socket = new DatagramSocket(sendingport);
                    Log.d("VR", "Socket Created");

                    int minBufSize = AudioTrack.getMinBufferSize(sampleRate, channelConfig, audioFormat);

                    byte[] buffer = new byte[minBufSize*10];


                    //minimum buffer size. need to be careful. might cause problems. try setting manually if any problems faced
                    //  int minBufSize = AudioTrack.getMinBufferSize(sampleRate, channelConfig, audioFormat);

                    speaker = new AudioTrack(AudioManager.STREAM_MUSIC,sampleRate,channelConfig,audioFormat,(minBufSize*10),AudioTrack.MODE_STREAM);

                    speaker.play();
                    while(status == true) {
                        try {


                            DatagramPacket packet = new DatagramPacket(buffer,buffer.length);
                            socket.receive(packet);
                            Log.d("VR", "Packet Received");

                            //reading content from packet
                            buffer=packet.getData();
                            Log.d("VR", "Packet data read into buffer");

                            //sending data to the Audiotrack obj i.e. speaker
                            speaker.write(buffer, 0, minBufSize);
                            Log.d("VR", "Writing buffer content to speaker");
                          //  Arrays.fill(buffer, Byte.parseByte(null));
                        } catch(IOException e) {
                            Log.e("VR","IOException");
                        }
                        catch(Throwable t){
                            Log.e("AudioTrack", "Playback Failed");
                        }
                    }


                } catch (SocketException e) {
                    Log.e("VR", "SocketException"+e.getMessage());
                }


            }

        });
        receiveThread.start();
    }
    private class RecordAudio extends AsyncTask<Void, Integer, Void> {
        <at> Override
        protected Void doInBackground(Void... params) {
            try {


                int minBufSize1 = AudioRecord.getMinBufferSize(sampleRate, channelConfig, audioFormat);
                DatagramSocket sendingsocket = new DatagramSocket();
                Log.d("VS", "Socket Created");
                byte[] buffer1 = new byte[minBufSize1*10];

                Log.d("VS", "Buffer created of size " + minBufSize1);
                DatagramPacket packet1;

                final InetAddress destination = InetAddress.getByName(ip.getText().toString());
                Log.d("VS", "Address retrieved");


                recorder = new AudioRecord(MediaRecorder.AudioSource.MIC, sampleRate, channelConfig, audioFormat, minBufSize1);
                Log.d("VS", "Recorder initialized");
                //  speaker = new AudioTrack(AudioManager.STREAM_MUSIC,sampleRate,channelConfig,audioFormat,(minBufSize*10),AudioTrack.MODE_STREAM);


                recorder.startRecording();
                // speaker.play();

                while (status == true) {


                    //reading data from MIC into buffer
                    minBufSize1 = recorder.read(buffer1, 0, buffer1.length);
                    Log.d("VS", "Reading");
                    //putting buffer in the packet
                    packet1 = new DatagramPacket(buffer1, buffer1.length, destination, recievingport);
                    Log.d("VS", "creating packet");
                    //   speaker.write(buffer, 0, minBufSize);
                    sendingsocket.send(packet1);
                   // Arrays.fill(buffer1, Byte.parseByte(null));

                }


            } catch (UnknownHostException e) {
                Log.e("VS", "UnknownHostException");
            } catch (Throwable t) {
                Log.e("AudioTrack", "Playback Failed");
            }
           /*    catch (IOException e) {
                Log.e("VS", "IOException");
               }*/

            return null;
        }
    }

    <at> Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_main, menu);
        return true;
    }

    <at> Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }
}


--
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 <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> 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 <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Mario Zechner | 21 Mar 02:39 2015
Picon

[RFC] What are your thoughts on cross-platform development for Android and iOS?

Hi,

i'm the guy behind libGDX (http://libgdx.badlogicgames.com) and am currently also working on RoboVM
(http://www.robovm.com) which allows you to run Java/Scala/Kotlin/... on iOS. Just like with libGDX,
my main concern with RoboVM is to make cross-platform app development easier for people coming from a
Java/JVM/Android background. We want to get input from the broader Android developer community to help
us shape the future of RoboVM. It would mean a lot to us, a team of 4 devs, if you find the time to comment on the
below blurb.

A lot of people here are working in app shops that probably create apps for customers or themselves that need
to work on both iOS and Android. Some may only focus on Android but may wish to expand to iOS.

There are a few frameworks/platforms out there that can help with sharing code between both Android and iOS
(C#, Java, JS, Ruby, pick your poison).

Some of these frameworks/platforms allow you to share business logic and use the native UI APIs on each
platform. This means you'll have to write the UI for each platform separately. The UX will most likely be
better, but at the expense of more development time. Let's call this the "native UI" solution.

Some frameworks allow you to share both the business logic and the UI code. A cross-platform UI API either
wraps the native UI API (lowest common denominator between the two platforms), or it uses something like a
webview, emulating the native UI. The UX will most likely be worse, but development time can be reduced.
Let's call this the "cross-platform UI" solution.

I'd be super happy if you have any input on the following questions
1. Do you think cross-platform development is viable at all? Why/Why not?
2. Would you rather use the "native UI" solution or the "cross-platform UI" solution? Why?

Our focus with RoboVM at the moment is on the "native UI" solution and making the code-sharing of the
business logic as easy as possible. Once this is complete, we also want to offer a "crossplatform UI"
solution. We are currently evaluating different approaches:

1. JavaFX. That's already alpha quality, there's a whole community around it and we enable them to work on
iOS. But it isn't the most natively looking & feeling option. It also carries the Swing heritage with it.
2. Webview. Quite flexible but shares all the same problems that Phonegap et. al. have (performance, look & feel).
3. Custom cross-platform UI. Gives us the most freedom. Maps a common API on top of native UI APIs, so the look
& feel is native. Might be a leaky abstraction though.

I do have my preferences regarding the above 3 options, but i'd really love to get input from you folks on that.
Thanks for your time, really appreciate it.

Ciao,
Mario

--

-- 
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 <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> 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 <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gmane