[android-developers] Digest for android-developers@googlegroups.com - 13 updates in 4 topics

Comments: (0)
Dan Cha <cubangt2@gmail.com>: Mar 31 02:50PM -0700

So im working or playing around with sending text/sms from within our app
as well as receiving replies. We will have the app on both ends(sender and
receiver devices)
But right now just prelim testing the messages are sent but they are
showing up as text within the default text app on the phone.
 
So even though our app sent the message a copy shows up in the default text
app as sent.
 
I have this in the manifest
<receiver android:name=".SMSBReceiver" >
<intent-filter android:priority="999" >
<action
android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
</receiver>
 
But as soon as the message is sent, its received in the default app. How
can we configure or code our app to send and receive within itself and not
affect the other text app?
 
Basically we want to contain the text within the app, anything initiated
within the app is only to show up in the app and no other sms app on the
devices.
 
Is this possible? We dont want copies of the text also showing up in the
users default text app.
 
thank you
 
Now with that said, if someone sends a actually text from outside the app,
then it should end up where it normally does for the user.
 
Hopefully that makes sense.
 
thank you
Kristopher Micinski <krismicinski@gmail.com>: Mar 31 06:47PM -0400

What's the motivation for doing this?
 
It seems kind of counterintuitive that you'd want to do this, because
presumably if the user *does* send a text, they want a record of it.
It's easy to imagine a spam app which sends tons of texts and leaves
no trace of it for the user to see!
 
But I'm a little confused by your question: it sounds like you're
talking about *receiving* texts as well? If you're the highest
priority, you should get the text first, and you should be able to
disable texts from the builtin app (though I think it's a little bit
of a hack).
 
If you must, however, you can always simply delete that text from the
sent folder on the phone.
 
Kris
 
 
Daniel Chacon <cubangt2@gmail.com>: Mar 31 06:31PM -0500

First it seemed easier to use sms to communicate between the apps. This
will only be used internally, so no public version. If there is another way
to communicate only within the app that will work also, basically don't
need to have the messages in 2 places, right now when I send a message it's
in the app and also in the default text app. Since the priority is set
high, is there a way to stop the message from moving onto the default app?
On Mar 31, 2015 5:51 PM, "Kristopher Micinski" <krismicinski@gmail.com>
wrote:
 
Kristopher Micinski <krismicinski@gmail.com>: Mar 31 07:58PM -0400

Using SMS to communicate *between* apps on the phone!?
 
You should 100% *not* be doing that. It's bad design, and it could
potentially cost your users money (if they pay for their texts).
 
You can use an intent, content provider, or AIDL, and it will be way
easier and much more obvious how to deal with than trying to hack it
like this.
 
Kris
 
 
Daniel Chacon <cubangt2@gmail.com>: Mar 31 08:36PM -0500

Well it's company phones with unlimited texting as well as
tablets. How would aidl, content providers or intent work between
them and office's miles apart?
This is a internal office app , if sms is not the way, then we
need a more optimal method.
On Mar 31, 2015 7:01 PM, "Kristopher Micinski" <krismicinski@gmail.com>
wrote:
 
Steve Gabrilowitz <steveg1701@gmail.com>: Mar 31 09:37PM -0400

So basically, you are trying to build a messenger app that uses SMS as a
transport layer but doesn't affect other SMS apps? Try investigating the
use of a data SMS rather than the usual text.
Kristopher Micinski <krismicinski@gmail.com>: Mar 31 09:58PM -0400

The usual way to do this sort of communication between apps on
different devices is to use a push notification. An example would be
Google Cloud Messaging, or Parse.
 
SMS would be possible, but just seems like a suboptimal solution when
things like GCM were designed to do exactly this: there are already
APIs and demos out there to handle this kind of communication.
 
Kris
 
 
Daniel Chacon <cubangt2@gmail.com>: Mar 31 09:38PM -0500

So found this example for data sms
http://stackoverflow.com/questions/3757229/how-to-send-and-receive-data-sms-messages
Daniel Chacon <cubangt2@gmail.com>: Mar 31 09:43PM -0500

So with gcm it mentions going thru our servers, so does that mean we
have to host something?
On Mar 31, 2015 9:02 PM, "Kristopher Micinski" <krismicinski@gmail.com>
wrote:
 
prudhvi p n v <prudhviraju1987@gmail.com>: Mar 31 08:49PM -0400

Thanks Justin ,
I fixed the issue now
and other issue I am working right now is to arrange the image , text in
proportions like 45% , 55%.
I want the image to occupy the 45% of the screen regardless of its size or
content or clarity .That's the reason I included framelayout and weightsum
(may not be a best option)
 
 
 
 
 

 
..
 
 
 
 
On Mon, Mar 30, 2015 at 3:55 PM, Justin Anderson <magouyaware@gmail.com>
wrote:
 
Justin Anderson <magouyaware@gmail.com>: Apr 01 12:58AM

Those layout percentages can be put directly on the image view and text
view so you don't need to wrap them in a frame layout.
 
You just mentioned three components though (image view and two text views)
but only broke our numbers as 55% and 45%...
 
What specific problem are you running into?
 
On Tue, Mar 31, 2015, 7:49 PM prudhvi p n v <prudhviraju1987@gmail.com>
wrote:
 
J Handal <jhandal7@gmail.com>: Mar 31 02:53PM -0500

Comment #1 on issue 162501 by al...@android.com: Where is my app
https://code.google.com/p/android/issues/detail?id=162501
J Handal <jhandal7@gmail.com>: Mar 31 02:50PM -0500

Updates:
Status: WrongForum
 
Comment #1 on issue 162501 by al...@android.com: Where is my app
https://code.google.com/p/android/issues/detail?id=162501
 
Sorry, this tracker is for issues with the Android OS only. Please use
https://support.google.com/ to obtain support for Google products or
services.
 
 
Nobody there only a lots of silly links
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to android-developers+unsubscribe@googlegroups.com.

[android-developers] Digest for android-developers@googlegroups.com - 2 updates in 2 topics

Comments: (0)
Justin Anderson <magouyaware@gmail.com>: Mar 30 07:55PM

I"m not entirely sure what you are trying to accomplish here. But I can
tell you that you are abusing layouts in a way they were never intended to
be used. For example, you don't need to wrap your TextView and ImageView
instances with a FrameLayout. That is overkill.
 
First thing I would try is removing all the FrameLayouts and putting the
layout_weight attributes directly on the View instances themselves. Try
that and see what happens. It may not fix your problem (I'm betting it
won't) but at least there won't be so many moving parts to try to figure
out.
 
On Wed, Mar 25, 2015 at 5:19 PM prudhvi p n v <prudhviraju1987@gmail.com>
wrote:
 
Alex D <alpha.lima.easy.xray@gmail.com>: Mar 30 06:53AM -0700

I need to query Android for the name of a font (either font file name, or
font family name) that supports the specific language or locale, and I
can't find any way of doing that - short of hardcoding the font name, which
is unreliable. I need this for my native app that uses the FreeType library
for drawing text: I have to detect and load the fonts with Japanese and
Chinese language support in order to display symbols from those languages.
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to android-developers+unsubscribe@googlegroups.com.

[android-developers] Digest for android-developers@googlegroups.com - 2 updates in 2 topics

Comments: (0)
app_developer <papamac38@googlemail.com>: Mar 27 04:30PM -0700

For in-app there is a purchase token which can be used for server side
validation of a purchased in-app
 
For a purchased app there is no token like that so one cannot do server
side validation against anything (AFAIK)
 
That's why I want to convert all users who purchased the app to users who
have an in-App which is functionally equivalent to the full purchased app
 
But this way (since it is an in-app it has a purchase token) I can use
server side validation
 
Is there a way to convert all the users that have paid an app to make them
automatically own an in-app element ?
 
Thanks
TreKing <trekingapp@gmail.com>: Mar 27 09:51PM +0900

On Mon, Mar 23, 2015 at 4:55 AM, BeEnder <philipp.bender.de@googlemail.com>
wrote:
 
> The registered connection callback is called successfully, but the given
> Bundle is always null.
 
 
What are you expecting? The documentation
<https://developer.android.com/reference/com/google/android/gms/common/api/GoogleApiClient.ConnectionCallbacks.html#onConnected%28android.os.Bundle%29>
says this can be null and the games setup docs
<https://developers.google.com/games/services/android/init> don't say you
need it, so it would seem like this is not a problem.
 
-------------------------------------------------------------------------------------------------
TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
transit tracking app for Android-powered devices
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to android-developers+unsubscribe@googlegroups.com.

[android-developers] Digest for android-developers@googlegroups.com - 3 updates in 2 topics

Comments: (0)
Daniel Chacon <cubangt2@gmail.com>: Mar 26 09:33AM -0500

So started working on the app again and before any new changes were made, i
ran the application and now the 1 record image that was loading is no
longer loading, can anyone see anything wrong with my implementation of the
Picasso?
 
ive already tested the link being used and all images are available via
browser, so images are there and available.
 
After my above post, i did add the following to the Picasso call and all
records always return the error image except the first record, but starting
today not even the first record shows the image.
So the placeholder image loads instantly, after a second or so, the error
image starts to load for all the records.
 
Picasso.with(context)
.load(item.Image)
.placeholder(R.drawable.waiting)
.error(R.drawable.errorradiationhazard)
.into(holder.imgItem);
 
Daniel Chacon <cubangt2@gmail.com>: Mar 26 05:10PM -0500

So i figured it out after doing a test of our insert portion, when we
inserted a new image and details, that one worked, and after some
investigation found that it was a space and Upper case issue..
 
It doesnt explain why it worked yesterday for 1 of the images and then no
longer worked today. But i changed the folder to NOT contain spaces in the
folder name and the biggest issue was that the image file names were all
Upper and lower case names.. So i changed all existing files to all lower
case and with the folder with no spaces, ran the app and they are now all
working as expected and pretty quickly.
 
Olivier Margarit <olivier.margarit@gmail.com>: Mar 26 07:36AM -0700

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 digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to android-developers+unsubscribe@googlegroups.com.

[android-developers] Digest for android-developers@googlegroups.com - 9 updates in 4 topics

Comments: (0)
AJ <ajayld@gmail.com>: Mar 24 10:39PM -0700

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
"Psy Khé" <psykhe6@gmail.com>: Mar 24 09:45PM -0300

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@istgroup.com.br
 
Confere lá!
 
Agradecido!
 
Abraços,
 
Psy Khé aka Saulo – By IST Group.
George Baker <spaceastronomer@gmail.com>: Mar 24 03:53AM -0700

I believe your problem is that you aren't returning the list from the background thread (doInBackground()). I can't tell from your changes where you are assigning a value to the items variable in you adapter constructor but it really should be from the result returned from your doInBacground() method. Also remember all ui access in an AsyncTask should be in either the on onPreExecute() or onPostExecute() methods.
 
Hope this helps,
George
Steve Gabrilowitz <steveg1701@gmail.com>: Mar 24 12:43PM -0400

Does your app have internet permission?
Daniel Chacon <cubangt2@gmail.com>: Mar 24 11:38AM -0500

yea after posting and reading over my code and other found, i had already
moved the listview binding code to the postexecute portion and works..
But today im trying to get the imageview to show the picture per record,
but again getting the error and cant seem to find in the logcat file why
its failing.
 
I changed things around to make the image bitmap part of items.
 
SoapObject suvas = (SoapObject)
dar.getProperty(i); if (suvas != null) { String c; String d; String o;
String img; String q; String serv = "http://www.site.com"; Bitmap ival;
c = suvas.getPropertySafelyAsString("Category").toString(); d =
suvas.getPropertySafelyAsString("Description").toString(); o =
suvas.getPropertySafelyAsString("Owned_x0020_By").toString(); img =
serv.concat(suvas.getPropertySafelyAsString("Picture").toString()); q =
suvas.getPropertySafelyAsString("Qty","null").toString(); try { ival =
BitmapFactory.decodeStream((InputStream) new
java.net.URL(img).getContent());
items[i] = new InventoryItem(c, o, d, ival, q); } catch (Exception e) {
e.printStackTrace(); } }
 
It ends up in the catch and returns a
java.io.FileNotFoundException: http://www.site.com/imgs/inventory/Video
Game/3_1_Vanellope.jpg
 
But if i copy the URL and paste into my browser, it opens the images fine..
all images are available, so im sure im doing something wrong.
 
Can anyone pin point any possible issues?
 
This is all within the original posted code, all ive done is change the few
lines above to try and get the image set to the imageview.
 
thank you
 
 
On Tue, Mar 24, 2015 at 5:53 AM, George Baker <spaceastronomer@gmail.com>
wrote:
 
Daniel Chacon <cubangt2@gmail.com>: Mar 24 11:50AM -0500

yes, it has had since i started..
 
this is what i have in the manifest
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
 
On Tue, Mar 24, 2015 at 11:43 AM, Steve Gabrilowitz <steveg1701@gmail.com>
wrote:
 
Daniel Chacon <cubangt2@gmail.com>: Mar 24 03:19PM -0500

Can anyone see why the image wouldnt show up, if it is getting a valid path?
 
 
 
Daniel Chacon <cubangt2@gmail.com>: Mar 24 05:22PM -0500

So i tried this right on the main page of the app and works using the path
that the other one is using.
 
ImageView imageView = (ImageView) findViewById(R.id.imageView);
 
Picasso.with(this)
.load("http://www.site.com/imgs/inventory/Video
Game/3_1_Vanellope.jpg")
.into(imageView);
 
So since this works with the path, how can i embed the above line into my
code to display each image path that is returned and added to my listview?
 
 
Rushyang Darji <rushyangdarji@gmail.com>: Mar 24 01:37PM

Hi, have you tried LensKart? I just did!
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to android-developers+unsubscribe@googlegroups.com.

[android-developers] Digest for android-developers@googlegroups.com - 4 updates in 2 topics

Comments: (0)
NewToAndroid <rahulrasal@gmail.com>: Mar 23 09:03AM -0700

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.
NewToAndroid <rahulrasal@gmail.com>: Mar 23 04:03PM -0700

Hi All,
 
Its me again. I am adding to my original post here.
Looks like it is permissioning problem.
 
I have added following lines in the manifest file,
 
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission
android:name="android.permission.ACCESS_NETWORK_STATE" />
 
Till now, I let Android development studio install the app directly on to
the phone, connected by USB cable. This time I copied the apk file from my
laptop(manually) to one folder on my phone (Galaxy S3). Then, I clicked on
the apk file ad installed it.
Before installing, the app installer asked "this app does not require any
special permissions, do you want to install ?". Why is this ??
As I have added the entries in the manifest file, I was expecting that,
before installing, Android will ask me about these 2 permissions.
 
Is there any problem with the build ? Do I need to change any setting in
studio so that, the apk file will pick up the permission information ??
 
Please help.
 
On Monday, March 23, 2015 at 4:03:38 PM UTC, NewToAndroid wrote:
Dan Cha <cubangt2@gmail.com>: Mar 23 02:50PM -0700

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;
}
 
@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﹕ !@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﹕ !@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﹕ !@Sync 7964
Dan Cha <cubangt2@gmail.com>: Mar 23 03:17PM -0700

So i moved these lines to onPostExecute and it loads my page with the
appropriate number of rows, but nothing is populated.
In the "items" there are the 26 rows that should be returned, and now the
page loads 26 rows but no data is seen on the page.
 
 
protected void onPostExecute(Void result)
{
CustomListView adapter = null;
adapter = new
CustomListView(ViewInventoryActivity.this,R.layout.activity_view_listview_single,items);
list = (ListView)findViewById(R.id.list);
list.setAdapter(adapter);
 
if(this.dialog.isShowing()){
this.dialog.dismiss();
}
}
 
 
On Monday, March 23, 2015 at 4:50:20 PM UTC-5, Dan Cha wrote:
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to android-developers+unsubscribe@googlegroups.com.

[android-developers] Digest for android-developers@googlegroups.com - 2 updates in 2 topics

Comments: (0)
BeEnder <philipp.bender.de@googlemail.com>: Mar 22 12:55PM -0700

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
israa mahmood <israamahmood1@gmail.com>: Mar 22 10:05AM -0700

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;
@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() {
 
@Override
public void onClick(View arg0) {
status = false;
recorder.release();
Log.d("VS", "Recorder released");
}
 
};
private final View.OnClickListener receiveListener = new
View.OnClickListener() {
 
@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() {
 
@Override
public void onClick(View arg0) {
status = true;
startStreaming();
PlayAudio a=new PlayAudio();
a.execute();
 
}
 
};
 
public void startStreaming() {
 
 
Thread streamThread = new Thread(new Runnable() {
 
@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> {
@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() {
 
@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> {
@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;
}
}
 
@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;
}
 
@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 digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to android-developers+unsubscribe@googlegroups.com.

[android-developers] Digest for android-developers@googlegroups.com - 3 updates in 2 topics

Comments: (0)
jtoolsdev <brianjtools@gmail.com>: Mar 21 03:25PM -0700

Really? If you know Android programming then HTML5 and Javascript should
be a piece of cake. And you probably don't need much knowledge of that to
change the example for your app. You can set up a server on your machine
to test. There's this thing called Google where you can search for that
info. Maybe you can use Github too. I think the example explains how to
do that but I just used my own web site.
 
Just knowing Android programming is not going to help you survive in the
tech world.
 
On Friday, March 20, 2015 at 4:23:01 AM UTC-7, saex wrote:
Guy Smith <guy@multiniche.org>: Mar 21 12:31AM -0700

My twopence worth... as a hobby app developer, my main concern is a
platform that puts up as few obstacles as possible.
 
I loathe "version hell": the code works under this version, but breaks
under that version ; the display is fine on most screens but breaks on
particular sizes ; yada yada.
 
Any cross-platform SDK has to sit on top of all these versions, from each
of Apple, Android, Microsoft, perhaps all the browser APIs if you're doing
web-enabled stuff, and any other random companies (Ubuntu, Samsung?) that
bring out a mobile platform.
 
Somewhere, you are going to have to make a trade-off. On some aspect,
you're going to be way behind the single platform SDKs. It might be
performance, complexity, features, robustness, whatever, but it's going to
be something.
 
Who do you expect to use your platform? For example, governments would want
to develop cross-platform apps as cheaply as possible and don't care about
performance or robustness, game developers probably care about performance,
retailers probably care about look&feel and robustness.
 
 
On Saturday, March 21, 2015 at 11:39:26 AM UTC+10, Mario Zechner wrote:
Mario Zechner <badlogicgames@gmail.com>: Mar 21 02:59AM -0700

Great input, thanks! As you said, with a cross-platform UI solution, there will always be platform/OEM/device specific issues that need special care. We can solve a lot of these on our end. There will obviously be cases we can't anticipate. The take away for me here is, that it should be possible for developers to easily special case in such a scenario. E.g. use the cross-platform API for 80% of the app, mix it with native APIs where necessary.
 
As for our target. Atm Android developers who want to expand to iOS more easily as well as Android/iOS devs who already do both platforms but want to unify their tooling and share code across platforms are our target. In terms of type of apps, we want to cover all the bases. Game Dev is already covered (via libGDX) with great success. Retailers are also covered, they can use the native APIs on each platform to get 100% native UX, while sharing business logic between platforms. Governmental and enterprise is what we currently are working on and at which my initial questions are aimed.
 
Thanks for the input, really appreciated!
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to android-developers+unsubscribe@googlegroups.com.