[android-developers] Different Business Models in different countries

2016-03-23 Thread Randall Green
Hi All,
Would appreciate some advice.

We are a US based company working to monetize a South African language app.  As 
Google has not included South Africa in the list of approved Google Merchants, 
the workflow we would need to create in order to publish a paid non-advertising 
app that can be purchased by South Africans through Google Play (without 
entering a 3rd party credit card or pre-paid card or something else) is painful 
to say the least.  My questions:

1. How have other publishers successfully monetized paid apps other than ad 
supported in countries that are not "merchant supported".  
2. Could we publish it as an ad supported app in South Africa and a paid app in 
the countries which are merchant supported (US, Australia, etc)?

Thanks very much in advance.

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/d6d4a663-52ec-4cc0-9506-25fcbb81130b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] Re: How to dismiss nested dialogfragment correctly after rotation?

2013-09-15 Thread Hand Green
Thank you a lot!
Just setting setRetainInstance(true) in DialogFragment is not enough. The
dialog just disappears after rotation.
I happen to find a thread:
http://stackoverflow.com/questions/8235080/fragments-dialogfragment-and-screen-rotation
In addition to setRetainInstance(true), we should override

@Override
public void onDestroyView() {
  if (getDialog() != null && getRetainInstance())
getDialog().setOnDismissListener(null);
  super.onDestroyView();
}

and it works!

However, it is very strange that "IllegalStateException: Can't retain
fragements that are nested in other fragments" does not occur.
ProgressDialog fragment is in fragmentA. It is nested.


2013/9/15 Piren 

> err, actually i've also missed something and read the stacktrace
> incorrectly. Only now i've noticed the NPE was actually in the framework
> code...
> If you didn't already, add SetRetainInstance to the DialogFragment as well
> (in its onCreate, not onCreateDialog).
> as a last resort you can always override onDismiss and avoid calling the
> base class (you should probably still call the Fragment.Dissmiss method and
> handle the BackStack on your own)
>
>
>
>
> On Sunday, September 15, 2013 3:25:41 PM UTC+3, Greenhand wrote:
>>
>> Yes. I am pretty sorry for my carelessness when extracting the related
>> code snippets.
>> new MyAsyncTask.execute() should be new MyAsyncTask(this).execute().
>>
>> As for the MyAsyncTask:
>>
>> public class MyAsyncTask extends AsyncTask{ //do network
>> operation
>>  private Fragment*A* fragment;
>>
>>  public MyAsyncTask(Fragment*A* fragmentA){
>>   fragment = fragmentA;
>>  }
>> If there is any mistake, please feel free to correct me.
>>
>>
>> Piren於 2013年9月15日星期日UTC+**8下午8時08分31秒寫道:
>>
>>> and did you use that constructor? because the code snippet shows you've
>>> used the default constructor
>>>
>>> On Sunday, September 15, 2013 1:52:22 PM UTC+3, Greenhand wrote:

 Thanks for pointing out the mistakes. The whole code is too long to
 post and maintain readability so I just put some snippet. The "MyAsyncTask
  having a constructor named GetTokenAsyncTask" is  a typo, the constructor
 should named MyAsyncTask.
 As for ProgressFragment, I use its toString() method to check using
 Log.d(). They are the same across rotation.



 2013/9/15 Piren 

> It's hard to follow your code since it seems some of it is incorrect
> (like  MyAsyncTask   having a constructor named GetTokenAsyncTask) and 
> some
> of it is missing...
> Either way you should verify you actually used that constructor (in
> the current code you don't, so the member "fragment" is null).Either case,
> you should also verify that the proper ProgressFragment is being set 
> during
> onAttach of FragmentA since i assume a new one will be created after
> rotation (though i'm not sure about that).
>
> Since this isn't that much code, you should probably just find a
> tutorial on how to do that (there's a lot of those online) and start from
> scratch (just so you wouldn't miss something)
>
> On Sunday, September 15, 2013 1:30:20 PM UTC+3, Greenhand wrote:
>>
>> I use appcompat library to host some fragments for tabs. In a
>> specific fragment A, I need to do network operation. In order not to 
>> block
>> the UI thread, I use an AsyncTask and do the network operation in
>> doInBackGround().
>>
>> To prevent messing around keep AsyncTask to survive rotation in the
>> fragment, I call setRetainInstance(true) in the fragment A oncreate().
>>
>> It works fine but I need to prompt user something when the network
>> operation is in progress. Therefore, I use DialogFragment. In the
>> DialogFragment onCreateView(), it instantiates a ProgressDialog and 
>> returns.
>>
>> To be concrete, the following is the code snippets of FragmentA,
>> MyDialogFragment and AsyncTask :
>> public class FragmentA extends Fragment{ //as tab for actionbar
>> (appcompat)
>>  private boolean isNetworkOperationCalled;
>>  private MyDialogFragment myDialogFragment;
>>  ...
>>  public void showProgressDialog(){ //for MyAsyncTask#onPreExecute()
>>   myDialogFragment = new MyDialogFragment();
>>   myDialogFragment.show(**getFra**gmentManager(), "mydialog");
>>  }
>>  public void showProgressDialog(){ //for MyAsyncTask#onPostExecute()
>>   myDialogFragment.dismiss();
>>  }
>>  public void onResume() {
>>   if(!**isNetworkOperationCalled**){
>>isNetworkOperationCalled=true;
>>new MyAsyncTask.execute();//do the network operation
>>   }
>>  }
>>  ...
>> }
>>
>>
>> public class MyDialogFragment extends DialogFragment{
>> //ProgressDialog for FragmentA
>>  ...
>>  public Dialog onCreateDialog(Bundle savedInstanceState) {
>>   ProgressDialog progressDialog = new ProgressDialog(getActivity(),**

Re: [android-developers] Re: How to dismiss nested dialogfragment correctly after rotation?

2013-09-15 Thread Hand Green
Thanks for pointing out the mistakes. The whole code is too long to post
and maintain readability so I just put some snippet. The "MyAsyncTask
 having a constructor named GetTokenAsyncTask" is  a typo, the constructor
should named MyAsyncTask.
As for ProgressFragment, I use its toString() method to check using
Log.d(). They are the same across rotation.



2013/9/15 Piren 

> It's hard to follow your code since it seems some of it is incorrect
> (like  MyAsyncTask   having a constructor named GetTokenAsyncTask) and some
> of it is missing...
> Either way you should verify you actually used that constructor (in the
> current code you don't, so the member "fragment" is null).Either case, you
> should also verify that the proper ProgressFragment is being set during
> onAttach of FragmentA since i assume a new one will be created after
> rotation (though i'm not sure about that).
>
> Since this isn't that much code, you should probably just find a tutorial
> on how to do that (there's a lot of those online) and start from scratch
> (just so you wouldn't miss something)
>
> On Sunday, September 15, 2013 1:30:20 PM UTC+3, Greenhand wrote:
>>
>> I use appcompat library to host some fragments for tabs. In a specific
>> fragment A, I need to do network operation. In order not to block the UI
>> thread, I use an AsyncTask and do the network operation in
>> doInBackGround().
>>
>> To prevent messing around keep AsyncTask to survive rotation in the
>> fragment, I call setRetainInstance(true) in the fragment A oncreate().
>>
>> It works fine but I need to prompt user something when the network
>> operation is in progress. Therefore, I use DialogFragment. In the
>> DialogFragment onCreateView(), it instantiates a ProgressDialog and returns.
>>
>> To be concrete, the following is the code snippets of FragmentA,
>> MyDialogFragment and AsyncTask :
>> public class FragmentA extends Fragment{ //as tab for actionbar
>> (appcompat)
>>  private boolean isNetworkOperationCalled;
>>  private MyDialogFragment myDialogFragment;
>>  ...
>>  public void showProgressDialog(){ //for MyAsyncTask#onPreExecute()
>>   myDialogFragment = new MyDialogFragment();
>>   myDialogFragment.show(**getFragmentManager(), "mydialog");
>>  }
>>  public void showProgressDialog(){ //for MyAsyncTask#onPostExecute()
>>   myDialogFragment.dismiss();
>>  }
>>  public void onResume() {
>>   if(!**isNetworkOperationCalled){
>>isNetworkOperationCalled=true;
>>new MyAsyncTask.execute();//do the network operation
>>   }
>>  }
>>  ...
>> }
>>
>>
>> public class MyDialogFragment extends DialogFragment{ //ProgressDialog
>> for FragmentA
>>  ...
>>  public Dialog onCreateDialog(Bundle savedInstanceState) {
>>   ProgressDialog progressDialog = new ProgressDialog(getActivity(),**
>> ProgressDialog.STYLE_SPINNER);
>>   ... //set the dialog attributes
>>   return progressDialog;
>>  }
>>  ...
>> }
>> public class MyAsyncTask extends AsyncTask{ //do network
>> operation
>>  private Fragment fragment;
>>
>>  public GetTokenAsyncTask(Fragment fragmentA){
>>   fragment = fragmentA;
>>  }
>>  protected void onPreExecute() {
>>   fragment.showProgressDialog(**); //show progess dialog for users
>>  }
>>  protected String doInBackground(Void... arg0) {
>>   ...
>>  }
>>  protected void onPostExecute() { //dismiss the dialog
>>   fragment.**dismissProgressDialog();
>>  }
>> }
>> In a nutshell, fragment A triggers AsyncTask and AsyncTask call methods
>> of FragmentA to show/dismiss dialog. Fragment A use MyDialogFragment to
>> show the progress dialog.
>>
>> The code (method) above works if there is no rotataion occurs while
>> doInBackground() is executing. Nevertheless, if the rotation happens before
>> onPostExecute() is called,
>> the rotation is fine and the progress dialog is retained. Sadly, it
>> crashes when onPostExecute() finally be called when dismissing the dialog.
>>
>> E/AndroidRuntime(27493): FATAL EXCEPTION: main
>> E/AndroidRuntime(27493): java.lang.NullPointerException
>> E/AndroidRuntime(27493):  at android.support.v4.app.**DialogFragment.**
>> dismissInternal(**DialogFragment.java:184)
>> E/AndroidRuntime(27493):  at android.support.v4.app.**
>> DialogFragment.dismiss(**DialogFragment.java:155)
>> E/AndroidRuntime(27493):  at com.example.FragmentA.**
>> dismissProgressDialog(**FragmentA.java:105)
>> E/AndroidRuntime(27493):  at com.example.FragmentA.access$**
>> 1(FragmentA.java:103)
>> E/AndroidRuntime(27493):  at com.example.FragmentA$**GetTokenAsyncTask.**
>> onPostExecute(FragmentA.java:**40)
>> E/AndroidRuntime(27493):  at com.example.FragmentA$**GetTokenAsyncTask.**
>> onPostExecute(FragmentA.java:**1)
>> E/AndroidRuntime(27493):  at android.os.AsyncTask.finish(**
>> AsyncTask.java:631)
>> E/AndroidRuntime(27493):  at android.os.AsyncTask.access$**
>> 600(AsyncTask.java:177)
>> E/AndroidRuntime(27493):  at android.os.AsyncTask$**
>> InternalHandler.handleMessage(**AsyncTask.java:644)
>> E/AndroidRuntime(27493):  at android.os.Handler.**
>> dispa

Re: [android-developers] Re: LoaderCallbacks.OnLoadFinished called twice in Fragments

2013-08-28 Thread Hand Green
Putting initLoader in onCreate() causes onLoadFinished() be called twice.

There is also another thread
http://stackoverflow.com/questions/11293441/android-loadercallbacks-onloadfinished-called-twice.
It suggest put initLoader in onCreate() in onResume(). It works but I do
not know why.


2013/8/28 Greenhand 

> Same.
>
> Although it is an old thread, I encounter the same issue, too. I find the
> thread
> http://stackoverflow.com/questions/11001475/listfragment-is-inflated-twice.
> It says put initLoader in onCreate() according to Fragment lifecycle (
> http://developer.android.com/guide/topics/fundamentals/fragments.html#Creating).
> I tried it. It works. Nonetheless, I am not sure if it is a correct way to
> solve the issue.
>
> Ben於 2012年11月23日星期五UTC+8下午10時41分32秒寫道:
>
>> Same
>>
>> On Wednesday, June 27, 2012 4:53:47 PM UTC+3, szakalinhoPL wrote:
>>>
>>> Hello,
>>> I noticed a strange situation when using Loader in Fragment (in Activity
>>> works well). I init Loader in onActivityCreated() as suggested in
>>> documentation (http://developer.android.com/**
>>> guide/components/loaders.html)
>>>  and after orientation change framework calls twice method LoaderCallbacks.
>>> **OnLoadFinished but not in initLoader (probably beacause Fragment is
>>> not in started state, but in docs there is information that I should be
>>> prepared for this (http://developer.android.com/**reference/android/app/
>>> **LoaderManager.html#initLoader(**int, android.os.Bundle,
>>> android.app.LoaderManager.**LoaderCallbacks)
>>> but it never happens) . However if I call iniLoader in Fragment.onResume()
>>> everything works as expected. The same issue is described here
>>> https://groups.google.**com/forum/?fromgroups#!topic/**
>>> android-developers/aA2vHYxSskU
>>> **. It happens using support library as well. Anyone noticed this
>>> situation? I wrote very simple application to test this issue, here is
>>> sample code:
>>>
>>>
>>> //Activity class
>>>
>>> package com.example;
>>>
>>> import android.app.Activity;
>>> import android.app.LoaderManager;
>>> import android.os.Bundle;
>>>
>>> public class MyActivity extends Activity
>>> {
>>> /**
>>>  * Called when the activity is first created.
>>>  */
>>> @Override
>>> public void onCreate(Bundle savedInstanceState)
>>> {
>>> super.onCreate(**savedInstanceState);
>>> setContentView(R.layout.main);
>>>
>>> LoaderManager.**enableDebugLogging(true);
>>> if (savedInstanceState == null)
>>> {
>>> getFragmentManager().**beginTransaction().add(R.id.**container,
>>> new TestFrag(), "asdf").commit();
>>> }
>>> }
>>> }
>>> //Fragment class
>>>
>>> package com.example;
>>>
>>> import android.app.Fragment;
>>> import android.app.LoaderManager;
>>> import android.content.Loader;
>>> import android.os.Bundle;
>>> import android.util.Log;
>>>
>>> public class TestFrag extends Fragment
>>> {
>>> @Override
>>> public void onActivityCreated(Bundle savedInstanceState)
>>> {
>>> super.onActivityCreated(**savedInstanceState);
>>> LoaderManager.LoaderCallbacks c = new
>>> LoaderManager.LoaderCallbacks(**)
>>> {
>>> @Override
>>> public Loader onCreateLoader(int id, Bundle args)
>>> {
>>> return new Loader(getActivity())
>>> {
>>> @Override
>>> protected void onStartLoading()
>>> {
>>> Log.d("TAG", "onStartLoading " + this);
>>> deliverResult(new Object());
>>> }
>>> };
>>> }
>>>
>>> @Override
>>> public void onLoadFinished(Loader loader, Object data)
>>> {
>>>  //THIS IS CALLED TWICE
>>> Log.d("TAG", "onLoadFinished " + data);
>>> }
>>>
>>> @Override
>>> public void onLoaderReset(Loader loader)
>>> {
>>> }
>>> };
>>> getLoaderManager().initLoader(**100, null, c);
>>>
>>> }
>>>
>>> }
>>>
>>>  --
> 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+unsubscr...@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 a topic in the
> Google Groups "Android Developers" group.
> To unsubscribe from this topic, visit

Re: [android-developers] android action bar background

2013-08-25 Thread Hand Green
Thank you.


2013/8/24 TreKing 

>
> On Fri, Aug 23, 2013 at 9:39 AM, Greenhand wrote:
>
>> Is there a way I can control the background scale method (i.e.
>> centerCrop) and see the ActionBar title?
>
>
> Not sure, but I'd try this:
>
> http://developer.android.com/guide/topics/resources/drawable-resource.html#Bitmap
>
> See the Xml Bitmap section, gravity property.
>
>
> -
> TreKing  - Chicago
> transit tracking app for Android-powered devices
>
> --
> 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+unsubscr...@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 a topic in the
> Google Groups "Android Developers" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/android-developers/GGs40_K-tDc/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to
> android-developers+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [android-developers] Re: Add a contact via ContentProvider programmatically

2013-08-20 Thread Hand Green
You are right! Thank you a lot!


2013/8/20 Nobu Games 

> I'm not completely sure but I think you need to create separate inserts
> for the name and the phone number. So make a separate insert for the phone
> number and don't forget to set the correct mime type for that.
>
>
> On Tuesday, August 20, 2013 9:01:48 AM UTC-5, Greenhand wrote:
>>
>> I have tried to add a contact ContentProvider programmatically but in
>> vain. The following is my code:
>>
>> import android.app.Activity;
>> import android.content.ContentUris;
>> import android.content.ContentValues;
>> import android.net.Uri;
>> import android.os.Bundle;
>> import android.provider.**ContactsContract.**CommonDataKinds.Phone;
>> import android.provider.**ContactsContract.**CommonDataKinds.**
>> StructuredName;
>> import android.provider.**ContactsContract.Data;
>> import android.provider.**ContactsContract.RawContacts;
>> import android.view.Menu;
>>
>> public class MainActivity extends Activity {
>>  @Override
>>  protected void onCreate(Bundle savedInstanceState) {
>> super.onCreate(**savedInstanceState);
>> setContentView(R.layout.**activity_main);
>>
>> ContentValues values = new ContentValues();
>> Uri rawContactUri = 
>> getContentResolver().insert(**RawContacts.CONTENT_URI,
>> values);
>> long rawContactId = ContentUris.parseId(**rawContactUri);
>> values.put(Data.RAW_CONTACT_**ID, rawContactId);
>> values.put(Data.MIMETYPE, StructuredName.CONTENT_ITEM_**TYPE);
>> values.put(StructuredName.**GIVEN_NAME, "Test"); //the contact name
>> values.put(Phone.NUMBER, "123456789"); //the contact phone number
>> values.put(Phone.TYPE, Phone.TYPE_MOBILE);
>> getContentResolver().insert(**android.provider.**
>> ContactsContract.Data.CONTENT_**URI, values);
>>  }
>>
>> with permission > android:name="android.**permission.WRITE_CONTACTS"
>> />
>>
>> However, the result is pretty weird. The first screenshot shows the name
>> "2" instead of "Test" and the second screenshot shows no phone number
>> instead of "123456789." Do I miss something?
>>
>  --
> 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+unsubscr...@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 a topic in the
> Google Groups "Android Developers" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/android-developers/9MJsu5F0NO4/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to
> android-developers+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [android-developers] Re: asynctask vs. FragmentRetainInstance.java in API demo

2013-02-07 Thread Hand Green
Thank you. It is very useful.

2013/2/6 Streets Of Boston 

> Instead of Threads or AsyncTasks that do the background work getting the
> data from the server, use Loader (AsyncLoader).
> You can use the LoaderManager to initially load them and also to restart
> them. Restarting them would allow you to implement your 'refresh'
> functionality.
>
>
>

-- 
-- 
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+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Re: asynctask vs. FragmentRetainInstance.java in API demo

2013-02-05 Thread Hand Green
As for ".. it is unnecessary for a worker fragment to start a asynctask
...", let me put it in another way.
Yes, I agree a fragment without UI is not a worker thread. Why I said "..
it is unnecessary for a worker fragment to start a asynctask ..." was about
the FragmentRetainInstance.java. It does not start a asynctask; It
creates a new thread instead. I hope it is clearer.

Thank you for giving clear and detailed explanation about how to use a
fragment without a UI. I really appreciate it!

With respect to the scenario of adding multiple UI-less fragments to my
activity, I would like to use UI-less fragments to perform an HTTP request,
such as performing GET request to a RESTful web service. In order to
provide the refresh function to users, I need to perform the request again
when a corresponding event happens, such as a button click event. I could
not figure out another way but only adding the same fragment to my
activity. It is why I am concerned about adding multiple UI-less fragements
to my activity. Is there another way to do so?

2013/2/5 Streets Of Boston 

> ".. it is unnecessary for a worker fragment to start a asynctask ..."
> I don't understand the statement above.  A Fragment without a UI is not a
> worker thread. It is just a Fragment without a UI.
>
> You can use it to tie data/tasks in the Fragment to the lifecycle of an
> activity that is hosting the Fragment:
>
> - If you want your data/tasks to survive configuration changes (e.g.
> orientation changes) that may destroy and recreate the hosting activity:
> Call 'setRetainInstance(true)' in the onCreate of your Fragment.
> Destroy/release/stop the data/task in your Fragment when the Fragment's
> onDestroy is called. This way your Fragment's instance will survive
> Activity rotations, etc.
>
> - If your Fragment has data/tasks that can be discarded when the screen
> (activity) is no longer visible or accessible to the user:
> In the onDetach of your Fragment, destroy/releases/stop the data/task,
> since the user will no longer be interested in the result of the data/task.
> Whether you'd like to implement this or not, depends on your app, on the
> functionality of that screen.
>
> - You don't need to add multiple UI-less fragments to your activity
> (depending on your app's needs). One is enough:
> In the onCreate of your activity, user the FragmentManager to see if your
> Fragment is already there (use the findFragmentBy... methods).
> If it is there, all is fine.
> If it is not there, create a new instance of your UI-less fragment and
> add/commit it to your activity.
> This makes sure you'll have only one instance of your Fragment that
> survives orientation changes and such (provided that the
> setRetainInstance(true) was called in the Fragment's onCreate).
>
>

-- 
-- 
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+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Re: asynctask vs. FragmentRetainInstance.java in API demo

2013-02-01 Thread Hand Green
Thank you for your response. If I use a fragment as a worker thread, I will
adapt the pattern in FragmentRetainInstance.java. Because it is unnecessary
for a worker fragment to start a asynctask, the worker thread can do the
task directly by using java.lang.Thread.

However, I still do not understand whether it is okay to add multiple
invisible fragments as worker threads to the UI and why it tries to stop
the thread in both onDestroy() and onDetach().

2013/2/1 Streets Of Boston 

> After your Fragment, the one without a UI, has started the AsyncTask, i.e.
> after the AsyncTask's 'execute' method has been called, it can stop it by
> calling 'cancel' on it.
>
>
> 
> 
> task.execute(...);
> ...
> ...
>
>
> And on some event, (Fragment's onDestroy for example), you just call.
> task.cancel(true);
>
> This will remove the task if it was scheduled or, if it is already
> running, interrupt the thread on which it is running.
> See more info about cancelling 
> 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@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Re: android imageview stretch to background height and keep ratio

2013-01-26 Thread Hand Green
I got it.
Thank you very much!

2013/1/26 lbendlin 

> Keep track of the banner height elsewhere (at the point where it gets
> measured and rendered),  and then use that measurement to specify the image
> height , and then through the aspect ratio, calculate the image width and
> the x-position of the image.
>
> If the images are subviews of the banner, then you could even override the
> banner's onLayout, rather than the one for the images.
>
>
>
> On Saturday, January 26, 2013 6:47:48 AM UTC-5, Greenhand wrote:
>>
>> Although I can keep the ratio, I do not know what my background height is
>> from parameters.
>> Could you give me some code snippetss?
>>
>> lbendlin於 2013年1月26日星期六UTC+**8下午7時33分50秒寫道:
>>
>>> Now that you have extended the object you can change the calculations
>>>  for measure to achieve your desired effect while keeping the image aspect
>>> ratio.
>>
>>  --
> --
> 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+unsubscr...@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 post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en




Re: [android-developers] Re: android imageview stretch to background height and keep ratio

2013-01-26 Thread Hand Green
I use dp. As far as I know, although I use dp to specify the height, it
still cannot resize dynamically according to the width.

2013/1/26 skink 

> Greenhand wrote:
> > To Piren:
> > Thank you. Assigning a specific height to the parent works.
> > The drawback is doing so is a little like hard code.
> > I would like a way to let android resize them dynamically since not all
> > sreen widths are the same.
> >
> >
> >
>
> did you specify the height as XXXpx?
>
> if so, use XXXdp (device independent pixels)
>
> pskink
>

-- 
-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en




Re: [android-developers] Re: android imageview stretch to background height and keep ratio

2013-01-24 Thread Hand Green
Because if I changed the two "inner" image views to match_parent, they will
expand the background imageview and its parent (RelativeLayout). It did not
work.

What I would like to do is let the inner imageviews resized automatically
to "exactly match" the background. If it is smaller, it will stretch to the
height of the background. If it is bigger, it will shrink to the height of
the background.

By the way, I think the "match_parent" attribute in Android is literally
misleading because it will make its parent bigger to "match_parent".
2013/1/25 Piren 

> if every imageview's height is wrap_content, why are you expecting them
> all to be the same (when all their sources are different sizes)?
> AdjustViewBounds isnt a magical property :)
> the two "inner" imageviews should be match_parent.
>
> it's also a good idea to define scaleType since it has the most relevancy
> when talking about keeping the image ratio.
>
>
>
>
>

-- 
-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en




Re: [android-developers] Re: New OpenGL ES 2.0 Game Engine Option

2013-01-18 Thread Robert Green
Hi Bob,

You're looking at the SDK documentation, which is used to write an
application in C++.  You don't need any of that to evaluate the engine, but
should you choose to use it later and build the engine for Android, the end
product is an .so which is all of the compiled SDK and Engine C++ code and
is used by the included Java files for the engine project.

Please find the engine documentation at
www.batterytechsdk.com/engine-documentation

Thanks


Robert Green
DIY at http://www.rbgrn.net/


On Fri, Jan 18, 2013 at 2:32 PM, bob  wrote:

> Ok, thanks.  BTW, I'm confused about something.
>
> I'm looking at the project named "batterytech" here:
>
> http://www.batterytechsdk.com/sdk-documentation/group___eclipse_setup.html
>
> Can you tell me what the end product is of building that?  Is it a .so
> file or .jar or something?
>
> How do the other projects link to the "batterytech" project?
>
>
>
>
>
> On Monday, January 14, 2013 1:29:05 PM UTC-6, Robert Green wrote:
>
>> Hi Bob,
>>
>> The SDK is the lower-level C++ platform and the engine is a game engine
>> written on top of the SDK that provides all the high level things a game
>> developer would want like animation, scripting, resource management, etc
>>
>>
>> Robert Green
>> DIY at http://www.rbgrn.net/
>>
>>
>> On Mon, Jan 14, 2013 at 11:17 AM, bob  wrote:
>>
>>> Okay.  By the way, what is the difference between BatteryTech SDK and
>>> BatteryTech Engine?
>>>
>>> Thanks.
>>>
>>>
>>>
>>> On Thursday, January 10, 2013 4:20:55 PM UTC-6, Robert Green wrote:
>>>
>>>> The mobile builds and projects are only available in the purchased
>>>> version.  The free dev kit is just Windows and OSX.
>>>>
>>>> If it works in your desktop build, it'll work on the device with the
>>>> exception of non power-of-two images.  On mobile you're just testing
>>>> performance and multitouch input before you're ready to release or
>>>> integrate any 3rd party products.
>>>>
>>>>
>>>> Robert Green
>>>> DIY at http://www.rbgrn.net/
>>>>
>>>>
>>>> On Thu, Jan 10, 2013 at 1:12 PM, bob  wrote:
>>>>
>>>>> Thanks.
>>>>>
>>>>>
>>>>> Can you tell me where to find the .so file?
>>>>>
>>>>>
>>>>> I don't see it in your two zip files.
>>>>>
>>>>>
>>>>>
>>>>> On Thursday, January 10, 2013 1:20:31 PM UTC-6, Robert Green wrote:
>>>>>
>>>>>> If you don't want to modify the engine itself you can just copy the
>>>>>> .so files and you don't need NDK.  If you want to change any of the C/C++
>>>>>> code in the engine, you'll need NDK to rebuild it for Android.
>>>>>>
>>>>>> When you're just developing your game, before device testing, you
>>>>>> don't need anything for Android.  It runs standalone on Windows and OSX.
>>>>>>
>>>>>>
>>>>>> Robert Green
>>>>>> DIY at http://www.rbgrn.net/
>>>>>>
>>>>>>
>>>>>> On Thu, Jan 10, 2013 at 8:50 AM, bob  wrote:
>>>>>>
>>>>>>> Thanks.
>>>>>>>
>>>>>>>
>>>>>>> I'll try to take a look at them when I get a chance.
>>>>>>>
>>>>>>>
>>>>>>> BTW, do you pretty much need the NDK to use your engine?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Thursday, January 3, 2013 12:20:09 PM UTC-6, Robert Green wrote:
>>>>>>>
>>>>>>>> Hi Bob,
>>>>>>>>
>>>>>>>> There are a number of games already available using BatteryTech
>>>>>>>> Engine that show off some of the basic capabilities, then we do 
>>>>>>>> include an
>>>>>>>> APK of our demo in the engine download so that you can try it out on 
>>>>>>>> your
>>>>>>>> device.  We'll be posting that to the market next week as well, but it 
>>>>>>>> is
>>>>>>>> available now in the archive.
>>>>>>>>
>>>>>>>> Here ar

Re: [android-developers] Re: New OpenGL ES 2.0 Game Engine Option

2013-01-14 Thread Robert Green
Hi Bob,

The SDK is the lower-level C++ platform and the engine is a game engine
written on top of the SDK that provides all the high level things a game
developer would want like animation, scripting, resource management, etc


Robert Green
DIY at http://www.rbgrn.net/


On Mon, Jan 14, 2013 at 11:17 AM, bob  wrote:

> Okay.  By the way, what is the difference between BatteryTech SDK and
> BatteryTech Engine?
>
> Thanks.
>
>
>
> On Thursday, January 10, 2013 4:20:55 PM UTC-6, Robert Green wrote:
>
>> The mobile builds and projects are only available in the purchased
>> version.  The free dev kit is just Windows and OSX.
>>
>> If it works in your desktop build, it'll work on the device with the
>> exception of non power-of-two images.  On mobile you're just testing
>> performance and multitouch input before you're ready to release or
>> integrate any 3rd party products.
>>
>>
>> Robert Green
>> DIY at http://www.rbgrn.net/
>>
>>
>> On Thu, Jan 10, 2013 at 1:12 PM, bob  wrote:
>>
>>> Thanks.
>>>
>>>
>>> Can you tell me where to find the .so file?
>>>
>>>
>>> I don't see it in your two zip files.
>>>
>>>
>>>
>>> On Thursday, January 10, 2013 1:20:31 PM UTC-6, Robert Green wrote:
>>>
>>>> If you don't want to modify the engine itself you can just copy the .so
>>>> files and you don't need NDK.  If you want to change any of the C/C++ code
>>>> in the engine, you'll need NDK to rebuild it for Android.
>>>>
>>>> When you're just developing your game, before device testing, you don't
>>>> need anything for Android.  It runs standalone on Windows and OSX.
>>>>
>>>>
>>>> Robert Green
>>>> DIY at http://www.rbgrn.net/
>>>>
>>>>
>>>> On Thu, Jan 10, 2013 at 8:50 AM, bob  wrote:
>>>>
>>>>> Thanks.
>>>>>
>>>>>
>>>>> I'll try to take a look at them when I get a chance.
>>>>>
>>>>>
>>>>> BTW, do you pretty much need the NDK to use your engine?
>>>>>
>>>>>
>>>>>
>>>>> On Thursday, January 3, 2013 12:20:09 PM UTC-6, Robert Green wrote:
>>>>>
>>>>>> Hi Bob,
>>>>>>
>>>>>> There are a number of games already available using BatteryTech
>>>>>> Engine that show off some of the basic capabilities, then we do include 
>>>>>> an
>>>>>> APK of our demo in the engine download so that you can try it out on your
>>>>>> device.  We'll be posting that to the market next week as well, but it is
>>>>>> available now in the archive.
>>>>>>
>>>>>> Here are a few games using it if you want to take a peek at them:
>>>>>>
>>>>>> Slyon Ball - https://play.google.com/**store/apps/details?id=com.
>>>>>> **slyonstudios.slyonball&hl=en<https://play.google.com/store/apps/details?id=com.slyonstudios.slyonball&hl=en>
>>>>>> The Digits: Fraction Blast - https://play.google.com/**stor
>>>>>> e/apps/details?id=com.**watchthedigits.fractionblast&**hl=en<https://play.google.com/store/apps/details?id=com.watchthedigits.fractionblast&hl=en>
>>>>>> Slyon Street Tuner - https://play.google.com/**stor
>>>>>> e/apps/details?id=com.**slyonstudios.streettuner<https://play.google.com/store/apps/details?id=com.slyonstudios.streettuner>
>>>>>> NSCRA Tuner Challenge - https://play.google.com/**stor
>>>>>> e/apps/details?id=com.**powerrevracing.nscra<https://play.google.com/store/apps/details?id=com.powerrevracing.nscra>
>>>>>>
>>>>>>
>>>>>>
>>>>>> Robert Green
>>>>>> DIY at http://www.rbgrn.net/
>>>>>>
>>>>>>
>>>>>> On Thu, Jan 3, 2013 at 12:10 PM, bob  wrote:
>>>>>>
>>>>>>> Cool.
>>>>>>>
>>>>>>>
>>>>>>> Maybe you could put an app in the Android Market that demos your new
>>>>>>> engine?
>>>>>>>
>>>>>>>
>>>>>>> This would make it easier for us to see what it can do.
>>>>>>>
>>>>>&g

Re: [android-developers] Re: New OpenGL ES 2.0 Game Engine Option

2013-01-10 Thread Robert Green
The mobile builds and projects are only available in the purchased version.
 The free dev kit is just Windows and OSX.

If it works in your desktop build, it'll work on the device with the
exception of non power-of-two images.  On mobile you're just testing
performance and multitouch input before you're ready to release or
integrate any 3rd party products.


Robert Green
DIY at http://www.rbgrn.net/


On Thu, Jan 10, 2013 at 1:12 PM, bob  wrote:

> Thanks.
>
>
> Can you tell me where to find the .so file?
>
>
> I don't see it in your two zip files.
>
>
>
> On Thursday, January 10, 2013 1:20:31 PM UTC-6, Robert Green wrote:
>
>> If you don't want to modify the engine itself you can just copy the .so
>> files and you don't need NDK.  If you want to change any of the C/C++ code
>> in the engine, you'll need NDK to rebuild it for Android.
>>
>> When you're just developing your game, before device testing, you don't
>> need anything for Android.  It runs standalone on Windows and OSX.
>>
>>
>> Robert Green
>> DIY at http://www.rbgrn.net/
>>
>>
>> On Thu, Jan 10, 2013 at 8:50 AM, bob  wrote:
>>
>>> Thanks.
>>>
>>>
>>> I'll try to take a look at them when I get a chance.
>>>
>>>
>>> BTW, do you pretty much need the NDK to use your engine?
>>>
>>>
>>>
>>> On Thursday, January 3, 2013 12:20:09 PM UTC-6, Robert Green wrote:
>>>
>>>> Hi Bob,
>>>>
>>>> There are a number of games already available using BatteryTech Engine
>>>> that show off some of the basic capabilities, then we do include an APK of
>>>> our demo in the engine download so that you can try it out on your device.
>>>>  We'll be posting that to the market next week as well, but it is available
>>>> now in the archive.
>>>>
>>>> Here are a few games using it if you want to take a peek at them:
>>>>
>>>> Slyon Ball - https://play.google.com/**stor**e/apps/details?id=com.**
>>>> slyonstu**dios.slyonball&hl=en<https://play.google.com/store/apps/details?id=com.slyonstudios.slyonball&hl=en>
>>>> The Digits: Fraction Blast - https://play.google.com/**stor**
>>>> e/apps/details?id=com.**watchthe**digits.fractionblast&**hl=en<https://play.google.com/store/apps/details?id=com.watchthedigits.fractionblast&hl=en>
>>>> Slyon Street Tuner - https://play.google.com/**stor**
>>>> e/apps/details?id=com.**slyonstu**dios.streettuner<https://play.google.com/store/apps/details?id=com.slyonstudios.streettuner>
>>>> NSCRA Tuner Challenge - https://play.google.com/**stor**
>>>> e/apps/details?id=com.**powerrev**racing.nscra<https://play.google.com/store/apps/details?id=com.powerrevracing.nscra>
>>>>
>>>>
>>>>
>>>> Robert Green
>>>> DIY at http://www.rbgrn.net/
>>>>
>>>>
>>>> On Thu, Jan 3, 2013 at 12:10 PM, bob  wrote:
>>>>
>>>>> Cool.
>>>>>
>>>>>
>>>>> Maybe you could put an app in the Android Market that demos your new
>>>>> engine?
>>>>>
>>>>>
>>>>> This would make it easier for us to see what it can do.
>>>>>
>>>>>
>>>>>
>>>>> On Tuesday, January 1, 2013 11:57:53 AM UTC-6, Robert Green wrote:
>>>>>
>>>>>> Thanks bob!  That game was from before BatteryTech and was the reason
>>>>>> we built a proper game engine.
>>>>>>
>>>>>>
>>>>>> Robert Green
>>>>>> DIY at http://www.rbgrn.net/
>>>>>>
>>>>>>
>>>>>> On Mon, Dec 31, 2012 at 7:38 PM, bob  wrote:
>>>>>>
>>>>>>>  Thanks.
>>>>>>>
>>>>>>> By the way, I tried your Deadly Chambers game.  It is impressive.  I
>>>>>>> like how the guy's name is Chambers.  Very funny.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Saturday, December 29, 2012 12:46:49 PM UTC-6, Robert Green wrote:
>>>>>>>>
>>>>>>>> Yes, texture mapping is fairly standard and is very well supported.
>>>>>>>>
>>>>>>>> BAI means "Binary Asset Import" and is a compact memory-safe format
>>>>&

Re: [android-developers] Re: New OpenGL ES 2.0 Game Engine Option

2013-01-10 Thread Robert Green
If you don't want to modify the engine itself you can just copy the .so
files and you don't need NDK.  If you want to change any of the C/C++ code
in the engine, you'll need NDK to rebuild it for Android.

When you're just developing your game, before device testing, you don't
need anything for Android.  It runs standalone on Windows and OSX.


Robert Green
DIY at http://www.rbgrn.net/


On Thu, Jan 10, 2013 at 8:50 AM, bob  wrote:

> Thanks.
>
>
> I'll try to take a look at them when I get a chance.
>
>
> BTW, do you pretty much need the NDK to use your engine?
>
>
>
> On Thursday, January 3, 2013 12:20:09 PM UTC-6, Robert Green wrote:
>
>> Hi Bob,
>>
>> There are a number of games already available using BatteryTech Engine
>> that show off some of the basic capabilities, then we do include an APK of
>> our demo in the engine download so that you can try it out on your device.
>>  We'll be posting that to the market next week as well, but it is available
>> now in the archive.
>>
>> Here are a few games using it if you want to take a peek at them:
>>
>> Slyon Ball - https://play.google.com/**store/apps/details?id=com.**
>> slyonstudios.slyonball&hl=en<https://play.google.com/store/apps/details?id=com.slyonstudios.slyonball&hl=en>
>> The Digits: Fraction Blast - https://play.google.com/**
>> store/apps/details?id=com.**watchthedigits.fractionblast&**hl=en<https://play.google.com/store/apps/details?id=com.watchthedigits.fractionblast&hl=en>
>> Slyon Street Tuner - https://play.google.com/**store/apps/details?id=com.
>> **slyonstudios.streettuner<https://play.google.com/store/apps/details?id=com.slyonstudios.streettuner>
>> NSCRA Tuner Challenge - https://play.google.com/**
>> store/apps/details?id=com.**powerrevracing.nscra<https://play.google.com/store/apps/details?id=com.powerrevracing.nscra>
>>
>>
>>
>> Robert Green
>> DIY at http://www.rbgrn.net/
>>
>>
>> On Thu, Jan 3, 2013 at 12:10 PM, bob  wrote:
>>
>>> Cool.
>>>
>>>
>>> Maybe you could put an app in the Android Market that demos your new
>>> engine?
>>>
>>>
>>> This would make it easier for us to see what it can do.
>>>
>>>
>>>
>>> On Tuesday, January 1, 2013 11:57:53 AM UTC-6, Robert Green wrote:
>>>
>>>> Thanks bob!  That game was from before BatteryTech and was the reason
>>>> we built a proper game engine.
>>>>
>>>>
>>>> Robert Green
>>>> DIY at http://www.rbgrn.net/
>>>>
>>>>
>>>> On Mon, Dec 31, 2012 at 7:38 PM, bob  wrote:
>>>>
>>>>>  Thanks.
>>>>>
>>>>> By the way, I tried your Deadly Chambers game.  It is impressive.  I
>>>>> like how the guy's name is Chambers.  Very funny.
>>>>>
>>>>>
>>>>>
>>>>> On Saturday, December 29, 2012 12:46:49 PM UTC-6, Robert Green wrote:
>>>>>>
>>>>>> Yes, texture mapping is fairly standard and is very well supported.
>>>>>>
>>>>>> BAI means "Binary Asset Import" and is a compact memory-safe format
>>>>>> of the internal structure of the open asset importer library.  We did
>>>>>> create it ourselves but it's simple, easy to maintain and extend and 
>>>>>> fully
>>>>>> compatible with version 2 of that library, which is why you can easily 
>>>>>> add
>>>>>> more formats to the engine.
>>>>>>
>>>>>> On Friday, December 28, 2012 2:24:49 PM UTC-6, bob wrote:
>>>>>>>
>>>>>>> Thanks.
>>>>>>>
>>>>>>>
>>>>>>> Also,
>>>>>>>
>>>>>>>
>>>>>>> Does it support texture-mapped models?
>>>>>>>
>>>>>>>
>>>>>>> And, is the BAI format your own invention?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Friday, December 28, 2012 11:28:48 AM UTC-6, Robert Green wrote:
>>>>>>>>
>>>>>>>> Out of the box it supports OBJ for static geometry and Collada
>>>>>>>> (DAE) for static and animated models.  We have a utility that will 
>>>>>>>> convert
>>>>>>>> either of th

Re: [android-developers] Re: New OpenGL ES 2.0 Game Engine Option

2013-01-03 Thread Robert Green
Hi Bob,

There are a number of games already available using BatteryTech Engine that
show off some of the basic capabilities, then we do include an APK of our
demo in the engine download so that you can try it out on your device.
 We'll be posting that to the market next week as well, but it is available
now in the archive.

Here are a few games using it if you want to take a peek at them:

Slyon Ball -
https://play.google.com/store/apps/details?id=com.slyonstudios.slyonball&hl=en
The Digits: Fraction Blast -
https://play.google.com/store/apps/details?id=com.watchthedigits.fractionblast&hl=en
Slyon Street Tuner -
https://play.google.com/store/apps/details?id=com.slyonstudios.streettuner
NSCRA Tuner Challenge -
https://play.google.com/store/apps/details?id=com.powerrevracing.nscra



Robert Green
DIY at http://www.rbgrn.net/


On Thu, Jan 3, 2013 at 12:10 PM, bob  wrote:

> Cool.
>
>
> Maybe you could put an app in the Android Market that demos your new
> engine?
>
>
> This would make it easier for us to see what it can do.
>
>
>
> On Tuesday, January 1, 2013 11:57:53 AM UTC-6, Robert Green wrote:
>
>> Thanks bob!  That game was from before BatteryTech and was the reason we
>> built a proper game engine.
>>
>>
>> Robert Green
>> DIY at http://www.rbgrn.net/
>>
>>
>> On Mon, Dec 31, 2012 at 7:38 PM, bob  wrote:
>>
>>>  Thanks.
>>>
>>> By the way, I tried your Deadly Chambers game.  It is impressive.  I
>>> like how the guy's name is Chambers.  Very funny.
>>>
>>>
>>>
>>> On Saturday, December 29, 2012 12:46:49 PM UTC-6, Robert Green wrote:
>>>>
>>>> Yes, texture mapping is fairly standard and is very well supported.
>>>>
>>>> BAI means "Binary Asset Import" and is a compact memory-safe format of
>>>> the internal structure of the open asset importer library.  We did create
>>>> it ourselves but it's simple, easy to maintain and extend and fully
>>>> compatible with version 2 of that library, which is why you can easily add
>>>> more formats to the engine.
>>>>
>>>> On Friday, December 28, 2012 2:24:49 PM UTC-6, bob wrote:
>>>>>
>>>>> Thanks.
>>>>>
>>>>>
>>>>> Also,
>>>>>
>>>>>
>>>>> Does it support texture-mapped models?
>>>>>
>>>>>
>>>>> And, is the BAI format your own invention?
>>>>>
>>>>>
>>>>>
>>>>> On Friday, December 28, 2012 11:28:48 AM UTC-6, Robert Green wrote:
>>>>>>
>>>>>> Out of the box it supports OBJ for static geometry and Collada (DAE)
>>>>>> for static and animated models.  We have a utility that will convert 
>>>>>> either
>>>>>> of those to a binary format called BAI to go to production because it's
>>>>>> smaller and loads faster.  The engine uses a library called Open Asset
>>>>>> Import which supports 30+ formats, so if you want more formats supported,
>>>>>> all you have to do is add in the format support files to either the 
>>>>>> engine
>>>>>> or the BAI conversion utility.  I think the only format that isn't
>>>>>> supported by Open Asset Importer is FBX, but autodesk has good FBX to DAE
>>>>>> conversion utilities that work, so there is that option.
>>>>>>
>>>>>> On Thursday, December 27, 2012 10:54:07 PM UTC-6, bob wrote:
>>>>>>>
>>>>>>> Looks interesting.  What 3d model formats does it support?
>>>>>>>
>>>>>>>
>>>>>>> On Thursday, December 27, 2012 5:24:59 PM UTC-6, Robert Green wrote:
>>>>>>>>
>>>>>>>> Hi All,
>>>>>>>>
>>>>>>>>  I'm a long time contributor of this group (over 400 posts I
>>>>>>>> think), developer of Deadly Chambers, Antigen and several other Android
>>>>>>>> games and just wanted to, in good will, let you know about the game 
>>>>>>>> engine
>>>>>>>> that we've been developing for the past 2 years.  It's called 
>>>>>>>> BatteryTech
>>>>>>>> Engine and is available at http://www.batterytechsdk.com .  It's
>>>>>>>> full OpenGL ES 2.0 and was designed around Andro

Re: [android-developers] Re: New OpenGL ES 2.0 Game Engine Option

2013-01-01 Thread Robert Green
Thanks bob!  That game was from before BatteryTech and was the reason we
built a proper game engine.


Robert Green
DIY at http://www.rbgrn.net/


On Mon, Dec 31, 2012 at 7:38 PM, bob  wrote:

> Thanks.
>
> By the way, I tried your Deadly Chambers game.  It is impressive.  I like
> how the guy's name is Chambers.  Very funny.
>
>
>
> On Saturday, December 29, 2012 12:46:49 PM UTC-6, Robert Green wrote:
>>
>> Yes, texture mapping is fairly standard and is very well supported.
>>
>> BAI means "Binary Asset Import" and is a compact memory-safe format of
>> the internal structure of the open asset importer library.  We did create
>> it ourselves but it's simple, easy to maintain and extend and fully
>> compatible with version 2 of that library, which is why you can easily add
>> more formats to the engine.
>>
>> On Friday, December 28, 2012 2:24:49 PM UTC-6, bob wrote:
>>>
>>> Thanks.
>>>
>>>
>>> Also,
>>>
>>>
>>> Does it support texture-mapped models?
>>>
>>>
>>> And, is the BAI format your own invention?
>>>
>>>
>>>
>>> On Friday, December 28, 2012 11:28:48 AM UTC-6, Robert Green wrote:
>>>>
>>>> Out of the box it supports OBJ for static geometry and Collada (DAE)
>>>> for static and animated models.  We have a utility that will convert either
>>>> of those to a binary format called BAI to go to production because it's
>>>> smaller and loads faster.  The engine uses a library called Open Asset
>>>> Import which supports 30+ formats, so if you want more formats supported,
>>>> all you have to do is add in the format support files to either the engine
>>>> or the BAI conversion utility.  I think the only format that isn't
>>>> supported by Open Asset Importer is FBX, but autodesk has good FBX to DAE
>>>> conversion utilities that work, so there is that option.
>>>>
>>>> On Thursday, December 27, 2012 10:54:07 PM UTC-6, bob wrote:
>>>>>
>>>>> Looks interesting.  What 3d model formats does it support?
>>>>>
>>>>>
>>>>> On Thursday, December 27, 2012 5:24:59 PM UTC-6, Robert Green wrote:
>>>>>>
>>>>>> Hi All,
>>>>>>
>>>>>> I'm a long time contributor of this group (over 400 posts I think),
>>>>>> developer of Deadly Chambers, Antigen and several other Android games and
>>>>>> just wanted to, in good will, let you know about the game engine that 
>>>>>> we've
>>>>>> been developing for the past 2 years.  It's called BatteryTech Engine and
>>>>>> is available at http://www.batterytechsdk.com .  It's full OpenGL ES
>>>>>> 2.0 and was designed around Android so that it would work really well
>>>>>> across over 1000 devices, maybe more.  It's free to develop but does
>>>>>> require a license to deploy.  The license gets you full engine source 
>>>>>> code
>>>>>> which is something you don't see often from comparable engines.  We
>>>>>> completely integrated Box2D and everything is bound to Lua to make it
>>>>>> really easy to script out game logic.  You can also deploy on other
>>>>>> platforms, but it works great specifically for Android too.
>>>>>>
>>>>>> Please let me know what you think, either here, privately or
>>>>>> otherwise.  Would love feedback and am always happy to support.
>>>>>>
>>>>>> Thanks everyone!!
>>>>>>
>>>>>  --
> 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+unsubscr...@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 post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: New OpenGL ES 2.0 Game Engine Option

2012-12-29 Thread Robert Green
Yes, texture mapping is fairly standard and is very well supported.

BAI means "Binary Asset Import" and is a compact memory-safe format of the 
internal structure of the open asset importer library.  We did create it 
ourselves but it's simple, easy to maintain and extend and fully compatible 
with version 2 of that library, which is why you can easily add more 
formats to the engine.

On Friday, December 28, 2012 2:24:49 PM UTC-6, bob wrote:
>
> Thanks.
>
>
> Also,
>
>
> Does it support texture-mapped models?
>
>
> And, is the BAI format your own invention?
>
>
>
> On Friday, December 28, 2012 11:28:48 AM UTC-6, Robert Green wrote:
>>
>> Out of the box it supports OBJ for static geometry and Collada (DAE) for 
>> static and animated models.  We have a utility that will convert either of 
>> those to a binary format called BAI to go to production because it's 
>> smaller and loads faster.  The engine uses a library called Open Asset 
>> Import which supports 30+ formats, so if you want more formats supported, 
>> all you have to do is add in the format support files to either the engine 
>> or the BAI conversion utility.  I think the only format that isn't 
>> supported by Open Asset Importer is FBX, but autodesk has good FBX to DAE 
>> conversion utilities that work, so there is that option.
>>
>> On Thursday, December 27, 2012 10:54:07 PM UTC-6, bob wrote:
>>>
>>> Looks interesting.  What 3d model formats does it support?
>>>
>>>
>>> On Thursday, December 27, 2012 5:24:59 PM UTC-6, Robert Green wrote:
>>>>
>>>> Hi All,
>>>>
>>>> I'm a long time contributor of this group (over 400 posts I think), 
>>>> developer of Deadly Chambers, Antigen and several other Android games and 
>>>> just wanted to, in good will, let you know about the game engine that 
>>>> we've 
>>>> been developing for the past 2 years.  It's called BatteryTech Engine and 
>>>> is available at http://www.batterytechsdk.com .  It's full OpenGL ES 
>>>> 2.0 and was designed around Android so that it would work really well 
>>>> across over 1000 devices, maybe more.  It's free to develop but does 
>>>> require a license to deploy.  The license gets you full engine source code 
>>>> which is something you don't see often from comparable engines.  We 
>>>> completely integrated Box2D and everything is bound to Lua to make it 
>>>> really easy to script out game logic.  You can also deploy on other 
>>>> platforms, but it works great specifically for Android too.
>>>>
>>>> Please let me know what you think, either here, privately or otherwise. 
>>>>  Would love feedback and am always happy to support.
>>>>
>>>> Thanks everyone!!
>>>>
>>>

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: New OpenGL ES 2.0 Game Engine Option

2012-12-28 Thread Robert Green
Out of the box it supports OBJ for static geometry and Collada (DAE) for 
static and animated models.  We have a utility that will convert either of 
those to a binary format called BAI to go to production because it's 
smaller and loads faster.  The engine uses a library called Open Asset 
Import which supports 30+ formats, so if you want more formats supported, 
all you have to do is add in the format support files to either the engine 
or the BAI conversion utility.  I think the only format that isn't 
supported by Open Asset Importer is FBX, but autodesk has good FBX to DAE 
conversion utilities that work, so there is that option.

On Thursday, December 27, 2012 10:54:07 PM UTC-6, bob wrote:
>
> Looks interesting.  What 3d model formats does it support?
>
>
> On Thursday, December 27, 2012 5:24:59 PM UTC-6, Robert Green wrote:
>>
>> Hi All,
>>
>> I'm a long time contributor of this group (over 400 posts I think), 
>> developer of Deadly Chambers, Antigen and several other Android games and 
>> just wanted to, in good will, let you know about the game engine that we've 
>> been developing for the past 2 years.  It's called BatteryTech Engine and 
>> is available at http://www.batterytechsdk.com .  It's full OpenGL ES 2.0 
>> and was designed around Android so that it would work really well across 
>> over 1000 devices, maybe more.  It's free to develop but does require a 
>> license to deploy.  The license gets you full engine source code which is 
>> something you don't see often from comparable engines.  We completely 
>> integrated Box2D and everything is bound to Lua to make it really easy to 
>> script out game logic.  You can also deploy on other platforms, but it 
>> works great specifically for Android too.
>>
>> Please let me know what you think, either here, privately or otherwise. 
>>  Would love feedback and am always happy to support.
>>
>> Thanks everyone!!
>>
>

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] New OpenGL ES 2.0 Game Engine Option

2012-12-27 Thread Robert Green
Hi All,

I'm a long time contributor of this group (over 400 posts I think), 
developer of Deadly Chambers, Antigen and several other Android games and 
just wanted to, in good will, let you know about the game engine that we've 
been developing for the past 2 years.  It's called BatteryTech Engine and 
is available at http://www.batterytechsdk.com .  It's full OpenGL ES 2.0 
and was designed around Android so that it would work really well across 
over 1000 devices, maybe more.  It's free to develop but does require a 
license to deploy.  The license gets you full engine source code which is 
something you don't see often from comparable engines.  We completely 
integrated Box2D and everything is bound to Lua to make it really easy to 
script out game logic.  You can also deploy on other platforms, but it 
works great specifically for Android too.

Please let me know what you think, either here, privately or otherwise. 
 Would love feedback and am always happy to support.

Thanks everyone!!

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] HDMI Mirroring multiple surface layers not working

2012-09-05 Thread Robert Green
We have 2 layers,

1)  SurfaceView with MediaPlayer attached to play video
2)  Translucent GLSurfaceView for interactive 3D on top of video

The configuration is really pretty simple:

MyGLSurfaceView glView = new MyGLSurfaceView (this);
((GLSurfaceView)glView ).setZOrderMediaOverlay(true);
((GLSurfaceView)glView 
).setBackgroundColor(getResources().getColor(android.R.color.transparent));
SurfaceView videoView = new SurfaceView(this);
videoView.getHolder().setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
setContentView(videoView, new LayoutParams(LayoutParams.FILL_PARENT, 
LayoutParams.FILL_PARENT));
addContentView((GLSurfaceView)glView, new 
LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));


This works normally on tons of devices, but when I connect an Asus 
Transformer tablet up via HDMI, it only shows the video layer and nothing 
from OpenGL. Basically it's not compositing the surface layers before 
pushing it to HDMI.

Shouldn't it be or is there something I'm missing?

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] SurfaceView-backed MediaPlayer crashing on some devices in stagefright

2012-08-19 Thread Robert Green
I need to play MP4 videos from assets and external files without built-in 
video controls.  This code works fine on a number of devices but there are 
some that are crashing in stagefright.  I'm following the instantiate, 
prepare, play lifecycle correctly I believe and have attached the 
mediaplayer to a surfaceview after the surface was successfully created. 
Has anyone experienced this exact problem and solved it?  Thanks!

I'm using the following basic code to play:

   @Override

protected void onCreate(Bundle savedInstanceState) {

 super.onCreate(savedInstanceState);

 requestWindowFeature(Window.FEATURE_NO_TITLE); 

 getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 
WindowManager.LayoutParams.FLAG_FULLSCREEN);

 getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

 setVolumeControlStream(AudioManager.STREAM_MUSIC);

videoView = new SurfaceView(this);

videoView.getHolder().addCallback(this);

setContentView(videoView, new LayoutParams(LayoutParams.FILL_PARENT, 
LayoutParams.FILL_PARENT));

 }

@Override

public void surfaceChanged(SurfaceHolder holder, int format, int width,

 int height) {

 Log.i(TAG, "surfaceChanged");

 if (width > 0 && height > 0) {

 loadVideo("big_buck_bunny.mp4");

}

}


 public void loadVideo(String assetName) {

 Log.i(TAG, "loadVideo");

 try {

 Log.i(TAG, "PlayVideo - attempting to load " + assetName);

 if (player != null) {

  player.stop();

  player.release();

 }

 player = new MediaPlayer();

 if (assetName.startsWith("file:")) {

  player.setDataSource(assetName.substring(5));

 } else {

  AssetFileDescriptor afd = getAssets().openFd(assetName);

  player.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), 
afd.getLength());

  // should we be calling afd.close()?

 }

 // videoView.getHolder().setFixedSize(640, 480);

 player.setDisplay(videoView.getHolder());

 playerReady = false;

 playerComplete = false;

 player.setOnPreparedListener(new OnPreparedListener() {

  public void onPrepared(MediaPlayer mp) {

  playerReady = true;

  playVideo(false);

  }

 });

 player.prepare();

 // player.prepareAsync();

 } catch (Exception e) {

 Log.e(TAG, "Error initializing video for " + assetName + ", " + 
e.getMessage());

 }

}

 public void playVideo(boolean loop) {

 Log.i(TAG, "playVideo");

 if (player != null) {

 player.setLooping(loop);

 if (playerReady) {

  Log.i(TAG, "PlayVideo - starting");

  player.start();

 } else {

  Log.i(TAG, "PlayVideo - not prepared, waiting");

  player.setOnPreparedListener(new OnPreparedListener() {

  public void onPrepared(MediaPlayer mp) {

   playerReady = true;

   Log.i(TAG, "PlayVideo - starting");

   player.start();

  }

  });

  player.setOnCompletionListener(new OnCompletionListener() {

  @Override

  public void onCompletion(MediaPlayer mp) {

   playerComplete = true;

  }

  });

 }

 }

}




And when I run that, I get the following log and crash:


I/MyActivity( 4370): PlayVideo - attempting to load big_buck_bunny.mp4

I/wpa_supplicant( 4175): [CTRL_IFACE]SIGNAL_POLL

I/wpa_supplicant( 4175): [CTRL_IFACE]SIGNAL_POLL

I/WindowManager(  142): MediaPlayer.isPlayingVideo

I/OMXCodec( 4006): [OMX.google.h264.decoder] AVC profile = 66 (Baseline), 
level = 30

I/OMXCodec( 4006): [OMX.google.h264.decoder] video dimensions are 320 x 240

I/OMXCodec( 4006): [OMX.google.h264.decoder] Crop rect is 320 x 240 @ (0, 0)

I/ActivityManager(  142): Displayed com.example.videotest/.MyActivity: 
+5s342ms

I/MyActivity( 4370): playVideo

I/MyActivity( 4370): PlayVideo - starting

I/OMXCodec( 4006): [OMX.google.h264.decoder] video dimensions are 640 x 360

I/OMXCodec( 4006): [OMX.google.h264.decoder] Crop rect is 640 x 360 @ (0, 0)

W/SoftAAC ( 4006): Sample rate was 44100 Hz, but now is 22050 Hz

F/SoftwareRenderer( 4006): 
frameworks/base/media/libstagefright/colorconversion/SoftwareRenderer.cpp:81 
CHECK(mConverter->isValid()) failed.

F/libc( 4006): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1)

I/DEBUG   (   84): *** *** *** *** *** *** *** *** *** *** *** *** *** *** 
*** ***

I/DEBUG   (   84): Build fingerprint: 
'BRONCHO/crane_a710/crane-a710:4.0.3/IML74K/20120320:eng/test-keys'

I/DEBUG   (   84): pid: 4006, tid: 4386  >>> /system/bin/mediaserver <<<

I/DEBUG   (   84): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 
deadbaad

I/DEBUG   (   84):  r0 deadbaad  r1 0001  r2 4000  r3 

I/DEBUG   (   84):  r4   r5 0027  r6 0168  r7 0280

I/DEBUG   (   84):  r8 0004  r9 0280  10 0168  fp 

I/DEBUG   (   84):  ip   sp 41c77918  lr 400bef01  pc 400bb660 
 cpsr 6030

I/DEBUG   (   84):  d0  6d284b4345484369  d1  65747265766e6f6c

I/DEBUG   (   84):  d2  6c615673693e2d65  d3  6166202929286464

I/DEBUG   (   84):  d4  6e6f69737265766e  d5  72617774666f532f

I/DEBUG   (   84):  d6  657265646e655265  d7  31383a7070632e72

I/DEBUG   (   84):  d8    d9  

I/DEBUG   (   84):  d

[android-developers] Re: OpenGL lockups in 2.2

2012-04-21 Thread Robert Green
We just did a big profiling, optimizing and tuning session on our
engine and found that we had LOTS of redundant Shader and Geometry
binds and unbinds.  We found that we never need to unbind from shaders
or disable vertex attributes because they are automatically all
disabled when switching shaders - then we made it so that glGetError
is only called when we have our debugging flags on... Result?  The
game that was crashing instantly on the EVO now runs without any
problems until the battery dies.

So - just another thing to look into.  Run your code in the Adreno
profiler with glFinish() on, remove all the redundant state changes
and unnecessary unbinds like texture, shader or vbo binds to 0 or
anything like that and see how it goes.  This worked for us.

On Apr 12, 10:59 am, cybice  wrote:
> Please look 
> athttps://developer.qualcomm.com/forum/qdevnet-forums/mobile-gaming-gra...
>
> i have no rooted phone,
> so please anybody who affected this bug, send to Qualcomm  a stack trace
> (using gdb) of all the threads of  the system_server process

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Accessing a class function from another class

2012-03-29 Thread Matt Green
Hi Lew,

Yeah, my terminology was a bit off.

I've got a class, an instance of which is run at program start:

public class ServerPushActivity extends Activity {
ListView listView1;
LogItemAdapter logItemAdapter;
ArrayList logs;
public void updateList(){

}
}

The updateList() function adds some items to the local ArrayList and
uses that to populate a ListView.
Then I have another Class which is triggered by the C2DM call:

public class C2DMMessageReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {

}
}


What I need is some way of getting the C2DMMessageReceiver.onRecieve()
function to run the ServerPushActivity.updateList() function against
the instance of ServerPushActivity that is created when the program
starts.

I'm thinking I need to do something with Intents, or I could be coding
the thing completely the wrong way and I need to move my data store
out of a variable local to the main function. It's a problem with
doing a fair amount of coding in the past (C, VB, PHP, etc), but this
is my first Android app, so I'm not used to all the android specific
bits.

Matt

On Mar 27, 7:29 pm, Lew  wrote:
> Matt Green wrote:
>
> > I've not been doing Android (or Java) programming very long, so I'm
> > still getting my head around the android/Java specific features.
> > I'm trying to integrate C2DM into a simple app I've made.
>
> > My current app grabs some JSON data and puts it into a ListView, this
> > is all handled within a single class. My app then polls the ser ver
> > regularly to see if there are any updates to the data.
>
> > I've then had a go at integrating C2DM into my app by adding in
> > classes and buttons from the C2DM tutorial at vogella.de (http://
> >www.vogella.de/articles/AndroidCloudToDeviceMessaging/article.html)
>
> > This works, I can get a message through telling me that there is new
> > data, however, I can't see how to integrate it any further.
>
> > What I want to do is have the C2DM class trigger a function in my main
> > class that will go collect the new data.
>
> > Any ideas what I should do?
>
> I am not familiar with C2DM but I can discuss the general Java idioms for
> this.
>
> The two most common mechanisms are polling and callbacks.
>
> A poller loops around, perhaps after a delay each cycle, usually in a
> background thread, checking for a desired state. After detecting that
> state, or after a timeout, the poller returns.
>
> A callback implements an interface that the service knows about. The
> service calls the known method on the callback object.
>
> By the way, unless you are using 'static' methods, and not really even
> then, a class doesn't call another class. An instance calls methods on an
> instance.
>
>  public interface FooListener
>  {
>    void doSomething( Gromitz gromitz );
>  }
>
>  public class FooClient implements FooListener, Runnable
>  {
>    private final transient Logger logger = getLogger(getClass());
>
>    private final FooService service = obtainFooService();
>
>    private Framxeg framxeg;
>
>    @Override public void doSomething( Gromitz gromitz )
>    {
>       framxeg = gromitz.getFramxeg();
>    }
>
>    public void init()
>    {
>       service.setListener(this);
>    }
>
>    @Override public void run()
>    {
>      if (service.getListener() != this)
>      {
>        IllegalStateException exc = new
> IllegalStateException("uninitialized");
>        logger.error(exc);
>        throw exc;
>       }
>       service.doYourThing();
>    }
>
>    public Framxeg getFramxeg()
>    {
>      return framxeg;
>    }
>  }
>
> --
> Lew

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Accessing a class function from another class

2012-03-29 Thread Matt Green
Hi Lew,

Yeah, my terminology was a bit off.

I've got a class, an instance of which is run at program start:

public class ServerPushActivity extends Activity {
ListView listView1;
LogItemAdapter logItemAdapter;
ArrayList logs;

public void updateList(){

}
}

The updateList() function adds some items to the local ArrayList and
uses that to populate a ListView.

Then I have another Class which is triggered by the C2DM call:
public class C2DMMessageReceiver extends BroadcastReceiver {

@Override
public void onReceive(Context context, Intent intent) {

}
}

What I need is some way of getting the C2DMMessageReceiver.onRecieve()
function to run the ServerPushActivity.updateList() function against
the instance of ServerPushActivity that is created when the program
starts.

I'm thinking I need to do something with Intents, or I could be coding
the thing completely the wrong way and I need to move my data store
out of a variable local to the main function. It's a problem with
doing a fair amount of coding in the past (C, VB, PHP, etc), but this
is my first Android app, so I'm not used to all the android specific
bits.

Matt

On Mar 27, 7:29 pm, Lew  wrote:
> Matt Green wrote:
>
> > I've not been doing Android (or Java) programming very long, so I'm
> > still getting my head around the android/Java specific features.
> > I'm trying to integrate C2DM into a simple app I've made.
>
> > My current app grabs some JSON data and puts it into a ListView, this
> > is all handled within a single class. My app then polls the ser ver
> > regularly to see if there are any updates to the data.
>
> > I've then had a go at integrating C2DM into my app by adding in
> > classes and buttons from the C2DM tutorial at vogella.de (http://
> >www.vogella.de/articles/AndroidCloudToDeviceMessaging/article.html)
>
> > This works, I can get a message through telling me that there is new
> > data, however, I can't see how to integrate it any further.
>
> > What I want to do is have the C2DM class trigger a function in my main
> > class that will go collect the new data.
>
> > Any ideas what I should do?
>
> I am not familiar with C2DM but I can discuss the general Java idioms for
> this.
>
> The two most common mechanisms are polling and callbacks.
>
> A poller loops around, perhaps after a delay each cycle, usually in a
> background thread, checking for a desired state. After detecting that
> state, or after a timeout, the poller returns.
>
> A callback implements an interface that the service knows about. The
> service calls the known method on the callback object.
>
> By the way, unless you are using 'static' methods, and not really even
> then, a class doesn't call another class. An instance calls methods on an
> instance.
>
>  public interface FooListener
>  {
>    void doSomething( Gromitz gromitz );
>  }
>
>  public class FooClient implements FooListener, Runnable
>  {
>    private final transient Logger logger = getLogger(getClass());
>
>    private final FooService service = obtainFooService();
>
>    private Framxeg framxeg;
>
>    @Override public void doSomething( Gromitz gromitz )
>    {
>       framxeg = gromitz.getFramxeg();
>    }
>
>    public void init()
>    {
>       service.setListener(this);
>    }
>
>    @Override public void run()
>    {
>      if (service.getListener() != this)
>      {
>        IllegalStateException exc = new
> IllegalStateException("uninitialized");
>        logger.error(exc);
>        throw exc;
>       }
>       service.doYourThing();
>    }
>
>    public Framxeg getFramxeg()
>    {
>      return framxeg;
>    }
>  }
>
> --
> Lew

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Accessing a class function from another class

2012-03-27 Thread Matt Green
Hi Guys,

I've not been doing Android (or Java) programming very long, so I'm
still getting my head around the android/Java specific features.
I'm trying to integrate C2DM into a simple app I've made.

My current app grabs some JSON data and puts it into a ListView, this
is all handled within a single class. My app then polls the ser ver
regularly to see if there are any updates to the data.

I've then had a go at integrating C2DM into my app by adding in
classes and buttons from the C2DM tutorial at vogella.de (http://
www.vogella.de/articles/AndroidCloudToDeviceMessaging/article.html)

This works, I can get a message through telling me that there is new
data, however, I can't see how to integrate it any further.

What I want to do is have the C2DM class trigger a function in my main
class that will go collect the new data.

Any ideas what I should do?

Cheers,

Matt

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] GL-related Crash on Xoom/Tab 10.1 requiring removal of battery or shell reboot?

2011-10-10 Thread Robert Green
Isn't this that really awful GL-related bug I've been talking about
for nearly 2 years?  I can't believe this still exists in honeycomb,
worse yet that it's nearly unrecoverable to tablet users that can't
remove their battery and don't have enough technical knowledge to use
ADB.

http://code.google.com/p/android/issues/detail?id=7432

IMO this should be upgraded to severe.  It's been plaguing Android
devices since 2.1

W/SharedBufferStack(  136): waitForCondition(LockCondition) timed out
(identity=3, status=0). CPU may be pegged. trying again.
W/SharedBufferStack(   78): waitForCondition(ReallocateCondition)
timed out
(identity=9, status=0). CPU may be pegged. trying again.
W/SharedBufferStack(   78): waitForCondition(LockCondition) timed out
(identity=5, status=0). CPU may be pegged. trying again.
W/SharedBufferStack(  381): waitForCondition(LockCondition) timed out
(identity=7, status=0). CPU may be pegged. trying again.
W/SharedBufferStack(  136): waitForCondition(LockCondition) timed out
(identity=3, status=0). CPU may be pegged. trying again.
...

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Logs not appearing in 3.1?

2011-06-29 Thread Robert Green
Scratch that - I'm seeing the logs (in the midst of a bazillion other
real-time logging statements) but it wasn't printing a stack trace on
a crash for me.  Anyone have an idea on that?

On Jun 29, 7:05 pm, James Wang  wrote:
> I do not see this problem. r u sure your app is up?

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Logs not appearing in 3.1?

2011-06-29 Thread Robert Green
Ever since my tab 10.1 got upgraded to 3.1, I no longer see my
application's log in logcat.  Does anyone know the reason for this and
how I can see it again?

Thanks!

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: In Android, how to get the keyevent of 'home Key' ?

2011-06-08 Thread Robert Green
Think of home like alt-tab in windows.  You never need to capture it.
You just need to handle onPause()/onStop() in a way that makes sense
for the user temporarily leaving your app.  You'll get onFinish() when
your app is to be actually destroyed.  If you have a need to actually
kill off the whole thing when home is pressed, call finish() in
onPause()/onStop() and you shall receive the touch of the droid
reaper, making for a clean start next time the user tries to enter the
activity.

On Jun 8, 10:31 am, Indicator Veritatis  wrote:
> Your blog post IS the best explanation I have seen to date of what the
> Home key really means. I thought it was particularly interesting that
> it emphasized something I have been dimly aware of but keep
> forgetting: unlike the Back key, pressing Home does NOT cause finish()
> to be called. I assume from your description that it triggers only one
> lifecycle callback, onPause(). It doesn't even itself trigger
> onStop(), which may or may not follow.
>
> But shouldn't it trigger onStop() too? After all, the application is
> no longer visible. And what about the Activity Stack? Doesn't pressing
> Home put the least recently used Activity on that stack?
>
> In fact, when I put Log.d statements in my main Activity for both
> onPause() and onStop(), I see both get called when I press the Home
> key.
>
> On Jun 8, 5:13 am, Mark Murphy  wrote:
>
>
>
>
>
>
>
> > On Wed, Jun 8, 2011 at 7:20 AM, Mark Murphy  wrote:
> > > On Wed, Jun 8, 2011 at 2:31 AM, Droid  wrote:
> > >> I need to know when the home button is pressed too (otherwise my app
> > >> returns to visibility again and again for ever).
>
> > > Then fix your bug.
>
> > >> (Please don't tell me I need to design my app
> > >> 'properly', I have been Android dev for over a year now)
>
> > > Tough. Design your app properly.
>
> > I just wrote up a blog post about why you should not care about the
> > HOME button and how better to solve this "problem":
>
> >http://commonsware.com/blog/2011/06/08/please-ignore-home-button.html
>
> > --
> > Mark Murphy (a Commons 
> > Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> > Android 3.0 Programming Books:http://commonsware.com/books

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: XLIFF for changing text value in TextView

2011-06-01 Thread Green Bell
change value of textview in code just like above:

TextView textView = new TextView(this);
textView.setText("change vaoue");


On 5月31日, 上午11時11分, JR  wrote:
> Hello everyone,
>
> I am trying to change the text value in TextView using the src file
> (.java). By default I set the value to
>
> android:text="TEST" in main.xml file under TextView
>
> what I want is to change the value using the java so I can change the
> text value anytime I want. I look for resources and found the XLIFF in
> a sample xml file which I suspect I need to add in my code. It looks
> like this
>
> connected to  id="device_name">%1$s
>
> I tried to understand the source codes of "BluetoothChat" sample to
> further understand the above code but I don't get it.
>
> If someone knows what I am talking about could you please help me?
> basically I only want to change the default text value in TextView
> that I set in the xml file through the src file (.java)
>
> Thanks a lot,
>
> JR

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Text scaling properly on two different mdpi devices (Evo, and Galaxy Tab 10.1)

2011-05-26 Thread Robert Green
I also want to do this exact same thing.  I don't want my text to be
the same physical size - I want it to be bigger when there are more
pixels regardless of density (yes it means super big text on a 10"
screen).  Since Android made compatibility mode a postage stampish
kind of mode on tablets instead of just magnifying (like I really,
really think it should have) it broke all my legacy games (they look
like crap on the tablets) and now I have lots more updating work to
do, but since I was stupid about it and used text views for games like
Wixel (which used to sound like a good idea for what kind of game it
was but now I'm regretting using anything other than a single custom
view that I have control over) I have a ridiculous amount of scaling
around of things that probably will need additional work later as
different screens come out...

On May 25, 11:49 am, Mike  wrote:
> OK.  Having a day or so to think about this, I think I asked the wrong
> question.
>
> So, let me try again:
>
> Is there way to do fontscalingsimilar to the way you can assign
> percentages to a layout?
>
> I realized that with my existing portrait mdpi layout, I was
> inadvertently relying on the height of some of my text to affect the
> placement of Views that came below the text.  This looks great on a
> myTouch, but crappy on a Galaxy Tab 10.1 since there are so many
> remaining vertical pixels (even with the fontscalingusing dp units.)
>
> Regards,
>
> - Mike
>
> On May 23, 4:46 pm, Dianne Hackborn  wrote:
>
>
>
>
>
>
>
> > The font size should be the same on those two devices (myTouch and Galaxy
> > Tab 10.1) because they have the same density.  What is bringing you to think
> > they should be different?
>
> > On Mon, May 23, 2011 at 3:34 PM, Mike wrote:
>
> > > Hi Dianne,
>
> > > Thanks for the quick reply.
>
> > > I understand density to be a function of native resolution versus
> > > physical display size.  So, the new Galaxy Tab 10.1 which has a native
> > > resolution of 800 x 1280 pixels and a physical display size of 10.1"
> > > diagonal ends up being a mdpi device.  When I populate a
> > > DisplayMetrics for the Galaxy Tab 10.1,  it gives me a density of 1.0
> > > and a density dpi of DENSITY_MEDIUM which confirms this.
>
> > > I misspoke with regard to the Evo.  I apologize.  It is indeed an hdpi
> > > device.
>
> > > In any case, I believe I still need to address this issue since a
> > > device such as the myTouch (320x480 native resolution) is an mdpi
> > > device as well.  Even though the myTouch and Galaxy Tab 10.1 have
> > > drastically different native resolutions as you point out.  I've been
> > > having difficulty using device independent units for my text size to
> > > make the font look appropriate on both devices since they map to the
> > > same layout file.
>
> > > - Mike
>
> > > On May 23, 4:16 pm, Dianne Hackborn  wrote:
> > > > Evo and Galaxy Tab are both hdpi (though the Tab technically should
> > > probably
> > > > be mdpi...  hdpi is okay though, it is just a design decision for the
> > > device
> > > > to make the overall UI larger).
>
> > > > Also density != "higher res".  It is REALLY REALLY important to
> > > understand
> > > > this.  The Xoom is mdpi but much higher resolution than the hdpi phones.
> > >  It
> > > > just has a bigger screen, but as a result is lower density.
>
> > > > If all you care about is the screen resolution (that is you don't care
> > > > really about having your UI size remain about the same across devices),
> > > then
> > > > don't use density which will pick resources based on *screen density* 
> > > > not
> > > > resolution.  You could instead use -nodpi and just do your own resource
> > > > selection based on how many pixels you have to use.
>
> > > > On Mon, May 23, 2011 at 2:35 PM, Mike  > > >wrote:
>
> > > > > I've started work to get my games to scale nicely for the higher-res
> > > > > displays like the Xoom and Galaxy Tab devices.
>
> > > > > I've made use of the ldpi/mdpi/hdpi/xhdpi folder naming convention for
> > > > > my resources which works nicely for layouts and graphics, but not so
> > > > > much for text sizescaling.  The problem is that an Evo and a Galaxy
> > > > > Tab 10.1 are both mdpi devices and will map to the same layout file.
> > > > > Yet, I need to scale the text size differently for these two devices.
> > > > > (I'm using text size units of dp.)
>
> > > > > Any ideas on something obvious I might be missing or any suggestions
> > > > > would be much appreciated.
>
> > > > > - Mike
>
> > > > > --
> > > > > 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+unsubscr...@googlegroups.com
> > > > > For more options, visit this group at
> > > > >http://groups.google.com/group/android-developers?hl=en
>
> > > > --
> > > >

[android-developers] Re: Scaling text up to be relative to screen pixels

2011-05-26 Thread Robert Green
Not possible, eh?

On May 26, 1:03 pm, Robert Green  wrote:
> I'm a long time Android developer (Been here since pre 1.0).  My focus
> is on games, so I don't care too much about the apps side of things.
> Generally I want a game to just consume the screen and everything to
> just scale up as a percentage (a button should always be 50% of the
> screen, etc).  I even want that on 10" tablets and whatever size
> future devices, because without scaling up, I have no other content so
> there will just be more blank space and a less predictable UI.
>
> I can work it out for buttons and such but how do I scale up text on
> my menus?  Saying, "use a surfaceview" is awesome for the game itself
> but all my legacy games have multiple activities for menus and use
> standard Android UI components.  They worked great on all screens
> before honeycomb/tablets, which are quickly becoming a major headache
> for me.
>
> Usually I just want 5 or so buttons laid out linearly vertically
> either in the center or on the right side of the screen (portrait/
> landscape) and I want the text on the buttons to scale up with the
> screen so it looks exactly the same at 1280x800 vs 480x320.  Am I
> missing something or is this not possible to do without adding
> additional layouts for larger screens (and potentially making even
> more layouts for even bigger screens later, etc)?
>
> Best practices to achieve this, anyone?

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] aspect-correct image scale-up

2011-05-26 Thread Robert Green
What's the right way to scale an arbitrary-sized image up to consume
all of one axis while maintaining aspect ratio using an ImageView/xml?

For instance, I have a 300px x 300px image I'd like to stretch up to
fill the screen while keeping aspect.  That means on a 480x800 screen,
it should be 480x480.  On a 1280x800 screen, it should be 800x800.  Is
there an easy way to do that or do I need to make my own custom view
that's smart about it?  I can, it just seems like something that
should be trivial to do without.

Yes, I have RTFM'd already and tried things like making the ImageView
fill one axis or the other while trying different scaleTypes like
fitCenter..

Thanks

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Scaling text up to be relative to screen pixels

2011-05-26 Thread Robert Green
I'm a long time Android developer (Been here since pre 1.0).  My focus
is on games, so I don't care too much about the apps side of things.
Generally I want a game to just consume the screen and everything to
just scale up as a percentage (a button should always be 50% of the
screen, etc).  I even want that on 10" tablets and whatever size
future devices, because without scaling up, I have no other content so
there will just be more blank space and a less predictable UI.

I can work it out for buttons and such but how do I scale up text on
my menus?  Saying, "use a surfaceview" is awesome for the game itself
but all my legacy games have multiple activities for menus and use
standard Android UI components.  They worked great on all screens
before honeycomb/tablets, which are quickly becoming a major headache
for me.

Usually I just want 5 or so buttons laid out linearly vertically
either in the center or on the right side of the screen (portrait/
landscape) and I want the text on the buttons to scale up with the
screen so it looks exactly the same at 1280x800 vs 480x320.  Am I
missing something or is this not possible to do without adding
additional layouts for larger screens (and potentially making even
more layouts for even bigger screens later, etc)?

Best practices to achieve this, anyone?

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Multi-touch pointer ids on Sony Xperia Play & spurious ACTION_DOWN events

2011-05-17 Thread Robert Green
Actually, it's not just native, but requires a native activity...
http://developer.sonyericsson.com/cws/download/1/921/870/1297178992/Accessing_Touch%20Events.pdf

I don't plan on supporting it until they can provide a normal native
lib or header or Java access.

On May 17, 2:10 pm, Robert Green  wrote:
> The regular buttons fire key events (up/down/left/right/sony shapes/L/
> R/select/start) so that is good but then there are these two magical
> analog pads that are a lot like the analog sticks on a PS3 controller
> and IIRC they are only accessible via a native library (though I
> haven't dug for the code to access them so I don't know yet how to use
> them).  Perhaps they will be supported as part of the peripherals in
> future Android APIs but for now I can only imagine that a person will
> need to link to a sony library and access via native so that means
> some JNI for Java-side support.
>
> On May 17, 12:38 pm, MichaelEGR  wrote:
>
>
>
>
>
>
>
> > On May 17, 12:25 pm, Robert Green  wrote:
>
> > > Testing on my xperia play shows that it goes up to Pointer ID 15 and
> > > then starts over again!  Why 15?  No clue...
>
> > WHAT? You mean you don't use your toes? ;P
>
> > > This is inconsistent behavior when compared to all other multitouch
> > > Android devices.  I'm going to end up implementing the same remapping
> > > solution for all my multitouch games and frameworks.
>
> > Yeppers.. doh.. meh... I suppose it's not the end of the world, but
> > yep I've got things isolated so I can just load a custom input filter
> > component for my event system to do the remapping just for this
> > device.
>
> > Can you please enlighten on the button matter for Java API support? I
> > recall you mentioning something about them only accessible on the
> > native side? It would be nice if they generated key events; please say
> > it's so!
>
> > BTW happy bday Rob!

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Multi-touch pointer ids on Sony Xperia Play & spurious ACTION_DOWN events

2011-05-17 Thread Robert Green
The regular buttons fire key events (up/down/left/right/sony shapes/L/
R/select/start) so that is good but then there are these two magical
analog pads that are a lot like the analog sticks on a PS3 controller
and IIRC they are only accessible via a native library (though I
haven't dug for the code to access them so I don't know yet how to use
them).  Perhaps they will be supported as part of the peripherals in
future Android APIs but for now I can only imagine that a person will
need to link to a sony library and access via native so that means
some JNI for Java-side support.

On May 17, 12:38 pm, MichaelEGR  wrote:
> On May 17, 12:25 pm, Robert Green  wrote:
>
> > Testing on my xperia play shows that it goes up to Pointer ID 15 and
> > then starts over again!  Why 15?  No clue...
>
> WHAT? You mean you don't use your toes? ;P
>
> > This is inconsistent behavior when compared to all other multitouch
> > Android devices.  I'm going to end up implementing the same remapping
> > solution for all my multitouch games and frameworks.
>
> Yeppers.. doh.. meh... I suppose it's not the end of the world, but
> yep I've got things isolated so I can just load a custom input filter
> component for my event system to do the remapping just for this
> device.
>
> Can you please enlighten on the button matter for Java API support? I
> recall you mentioning something about them only accessible on the
> native side? It would be nice if they generated key events; please say
> it's so!
>
> BTW happy bday Rob!

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Multi-touch pointer ids on Sony Xperia Play & spurious ACTION_DOWN events

2011-05-17 Thread Robert Green
Testing on my xperia play shows that it goes up to Pointer ID 15 and
then starts over again!  Why 15?  No clue...

This is inconsistent behavior when compared to all other multitouch
Android devices.  I'm going to end up implementing the same remapping
solution for all my multitouch games and frameworks.

On May 17, 5:51 am, Mario Zechner  wrote:
> So, i wondered why we had that assumption. Back in 2009/early 2010
> when 2.0 came out and the Droid blew away the world this group was
> full of multi-touch related topics. Dianne Hackborn answered ALL our
> questions back then, a feat that probably took up all her work
> time :P. She also explained how pointer ids are handed out by the
> system.
>
> original 
> message:http://groups.google.com/group/android-developers/msg/2786021d43ae196d
>
> quote:  "If finger A goes down, then finger B, then finger A
> is released, you will see pointer #0 going up and the following
> movements
> will have only pointer ID #1 (at index 0 because that is the only
> active
> pointer).  When the next finger goes down, it is given the first
> available
> pointer ID (there is no way to know "which" finger this is, so we
> assume the
> first available), thus you see a new pointer ID 0 going down."
>
> So, the first available pointer id is chosen. That was our assumption
> as well. There are a few more threads on the group that go into
> pointer ids and how they are generated.
>
> It seems theXperiabreaks this assumption. Would be nice to hear an
> official word on this.
>
> On 17 Mai, 04:25, Michael Leahy  wrote:
>
>
>
>
>
>
>
> > >"It looks indeed as if Sony was brewing their own special kind of
>
> > 'fragmentation'"
>
> > I've come to a succinct definition of "fragmentation" at least from a
> > developer perspective as unfortunately this term is widely "misused and
> > abused" in the press and sometimes twisted in definition by organizations
> > that produce it.
>
> > "Fragmentation is what happens when OS and device differentiation fails to
> > honor standards and contracts of developer APIs."
>
> > This covers faults in various OS versions and various ODM faults as well at
> > least from a developer perspective.  OS / device differentiation should be
> > celebrated; fragmentation as defined above... not so much.
>
> > --Mike
>
> > On Mon, May 16, 2011 at 7:08 PM, Mario Zechner 
> > wrote:
>
> > > I don't have direct physical access to anXperiamyself so i can't
> > > comment on the button issues Robert discovered. It looks indeed as if
> > > Sony was brewing their own special kind of "fragmentation".

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] horizontal view increasing the size of a text box

2011-05-13 Thread green hoodlum
Hi,

i'm currently attempting to work out how to have 4 text boxes, 2 per
row. i don't have a problem implementing this with a tablelayout/
tablerow where the text boxes of equal sizes.

i.e:

box1  box2
box3  box4

what i'd like to try is to have the 4th box to be a larger size.


so for instance either:

box1  box2
box3  box4   <--the height of box4 stretches to the end of  the
screen



OR:

box1 box4  <-- box4 spans the width of box1-3
box2
box3




any advice is appreciated.

gh

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: 3d engine advices

2011-04-13 Thread Robert Green
It's not an engine but it's worth mentioning - 
www.batterypoweredgames.com/batterytech

This is a shameless plug.  I wrote it, use it and advocate it :)

On Apr 13, 10:40 am, Peter Eastman  wrote:
> > As a note; The game was better than I expected to see :).
>
> Thank you. :)
>
> > You should consider using a different license though, LGPL and Android 
> > don't mix well due to the dex format
>
> Yes, other people have mentioned that to me.  I'm planning to switch
> to BSD in the next version.  And if you want to use it now, let me
> know and I'll go ahead and check in the changed headers on all the
> source files listing the new license.
>
> Peter

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: OpenGL ES 2.0 Shader Access Client Memory

2011-04-06 Thread Robert Green
You can do lots of interesting tricks with memory with shaders,
particularly pixel shaders.  Many implementations put all types of
wild data into textures that aren't images and access that with a
swizzle in the pixel shader as whatever 32 bit values they needed.

You need to learn GLES2 to understand better.  You can basically only
pass uniforms, vertex attributes and texture samplers to shaders.
Everything you can do must be through that API.

Yes you can draw a quad from 4 verts.  You just need to either do 2
indexes triangles if drawing multiple 4-vert quads in one draw batch
or you can do it as a single draw using trianglefan or trianglestrip.

On Apr 5, 3:19 pm, Jonathan  wrote:
> From what I understand, the GPU in Android devices uses shared memory->RAM. 
> So I'm thinking it must be possible to have a shader access
>
> client memory directly.
>
> The ideal would be to be able to pass an array pointer to the shader
> and be able to access a value in that array using that pointer, in the
> shader. If this is not possible I would still like to know the best
> way of doing something like this.
>
> (I also have another small question: would it be possible to draw a
> quad from only 4 vertices in OpenGL ES 2.0?)

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Do OpenGL ES 2.0 phones also support ES 1.1?

2011-04-04 Thread Robert Green
Right now - yes, they do.  AFAIK, most GLES 1.0/1.1 implementations on
2.0-standard chips are always using 2.0 internally but the driver has
1.1-compatibility shaders that it uses behind the scenes to implement
fixed-function emulation.

for your problem - if those are two totally different chips, you may
have done a few strange things that you thought were fine because they
worked on your test device but the other device didn't like them.
Correctly-implemented GLES should (in theory) work on all devices
unless they have bugs.  If it's not working, you probably did
something to make it angry.

On Apr 4, 8:27 am, GJTorikian  wrote:
> Given that the APIs for OpenGL ES 2.0 and 1.1 are incompatible, I was
> wondering if there is always some inherent support for both in
> Android, or if it was on a per phone basis.
>
> I am developing an ES 1.1 game. On my phone, a nearly two year old
> model, the game drew quite well, visually. On my friend's newish Droid
> 2, all I saw were choppy polygons. I know my phone can't do ES 2.0 and
> I assume his can.

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Where to start with simple video games?

2011-03-29 Thread Robert Green
If all you want is canvas drawing, just use a surfaceview.  If you
want OpenGL, use a GLSurfaceView.

Those are all you need.

On Mar 28, 5:53 pm, Toby  wrote:
> I'm finishing up my first app for my company, so I
> am getting more comfortable with android.  I'd like
> to do a personal project now, something like a spacewar
> game.  I figured that there would be a canvas widget
> somewhere, and that given canvas.plot(x, y) I'd be on
> my way.
>
> It seems that there is a large selection of surfaces
> to draw on.  I find it confusing.  Is there a decent
> guide to two dimensional game writing on android?
>
> Thanks,
>
> Tobiah

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Open GL texture is shown on emulator but not on the mobile

2011-03-25 Thread Robert Green
What resource directory is your bitmap in?  drawable-nodpi?

On Mar 25, 10:23 am, MobileVisuals  wrote:
> I tried to run a OpenGL tutorial project
>
> http://obviam.net/index.php/texture-mapping-opengl-android-displaying...
>
>  on a Samsung Galaxy, but only a white rectangle is shown instead of
> the texture. The texture is shown on the emulator, but not on the
> Samsung Galaxy.  What do I have to do to see the texture on the device?

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: OpenGL texture display properly on my phone. But 'white box' on some device?

2011-03-17 Thread Robert Green
It's usually either NPOT or not handling texture IDs and bindings
correctly :)

I've seen code where people made their own texture IDs incrementally
as they didn't know to use glGenTextures - and it works on many
drivers but certainly breaks on some.

On Mar 17, 2:25 pm, String  wrote:
> Looking at your code, it appears that the source image is in res/raw, which
> is a good practice for textures. It should insure that they don't prescale.
>
> Nonetheless, Robert's advice is good: debug into it and check the actual
> dimensions. In my experience, non-power-of-two dimensions is almost always
> the reason behind the dreaded "white box".
>
> String

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: OpenGL texture display properly on my phone. But 'white box' on some device?

2011-03-17 Thread Robert Green
Debug the actual bitmap dimensions after you decode it.  It could be
getting scaled if you don't have it in drawable-nodpi.

I also remember something about clamp vs repeat with non-square power-
of-two textures on some chips, but that may be for something else.  I
see you're not using mips here but if you do, remember they must be
square, not just PoT.

What dir is the texture file you're loading in?

On Mar 17, 11:41 am, Kakyoin  wrote:
> *** Update ***
>
> Today I just updated my Motorola Milestone to Android 2.2 and this bug
> is now happening on my device !!
>
> The texture was displaying fine when my Milestone was Android 2.1
> yesterday.
>
> I hope this piece of info will greatly help solving this problem.

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: 24 bit color for GL surface?

2011-03-16 Thread Robert Green
So are you saying the correct way is to set translucency and write a
custom config chooser that picks ?

On Mar 16, 4:03 pm, Romain Guy  wrote:
> Setting translucency will pick RGBA. You still have to choose the proper
> config though.
>
>
>
>
>
>
>
>
>
> On Wed, Mar 16, 2011 at 3:43 PM, Robert Green  wrote:
> > Thanks Romain,
>
> > So what's the correct, complete solution?  Set the window to RGBA
> > then use 8 8 8 8 for the egl config chooser or is translucency
> > preferred?  I just want something that won't be finicky and break on
> > future chips/devices/oem impls.
>
> > On Mar 16, 3:05 pm, Romain Guy  wrote:
> > > RGBA should be supported on all devices, but you are asking for
> > RGBX
> > > which may not be supported.
>
> > > On Wed, Mar 16, 2011 at 10:04 PM, Robert Green 
> > wrote:
> > > > I remember that early Android devices were all 16 bit color (RGB_565)
> > > > but read something about 24 bit color support on newer devices?  I'd
> > > > like to enable it in a safe way if possible for my surface/pixelformat
> > > > for GL but I'm not getting a valid egl config back.
>
> > > > I've tried:
>
> > > > setEGLConfigChooser(8, 8, 8, 0, 16, 0); // 24 bit color, no alpha, 16
> > > > bit depth buffer, no stencil buffer
> > > > getHolder().setFormat(PixelFormat.TRANSLUCENT); // supposedly makes it
> > > > use 
>
> > > > On a galaxy s and no dice.
>
> > > > So my questions are:  Do any devices support high color and if so, is
> > > > there a good way to use it when available but fall back to 16 bit when
> > > > not for OpenGL?
>
> > > > I found this snippet somewhere, but haven't tried doing this in combo
> > > > with the pixelformat:
>
> > > > public class MyActivity extends Activity {
> > > >  @Override
> > > >  public void onAttachedToWindow() {
> > > >    super.onAttachedToWindow();
> > > >    Window window = getWindow();
> > > >    window.setFormat(PixelFormat.RGBA_);
> > > >  }
> > > > }
>
> > > > Does anyone have experience with this?
>
> > > > Thanks!
>
> > > > --
> > > > 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+unsubscr...@googlegroups.com
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/android-developers?hl=en
>
> > > --
> > > Romain Guy
> > > Android framework engineer
> > > romain...@android.com
>
> > > Note: please don't send private questions to me, as I don't have time to
> > > provide private support.  All such questions should be posted on public
> > > forums, where I and others can see and answer them
>
> > --
> > 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+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Romain Guy
> Android framework engineer
> romain...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support.  All such questions should be posted on public
> forums, where I and others can see and answer them

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: 24 bit color for GL surface?

2011-03-16 Thread Robert Green
Thanks Romain,

So what's the correct, complete solution?  Set the window to RGBA
then use 8 8 8 8 for the egl config chooser or is translucency
preferred?  I just want something that won't be finicky and break on
future chips/devices/oem impls.

On Mar 16, 3:05 pm, Romain Guy  wrote:
> RGBA should be supported on all devices, but you are asking for RGBX
> which may not be supported.
>
>
>
>
>
>
>
>
>
> On Wed, Mar 16, 2011 at 10:04 PM, Robert Green  wrote:
> > I remember that early Android devices were all 16 bit color (RGB_565)
> > but read something about 24 bit color support on newer devices?  I'd
> > like to enable it in a safe way if possible for my surface/pixelformat
> > for GL but I'm not getting a valid egl config back.
>
> > I've tried:
>
> > setEGLConfigChooser(8, 8, 8, 0, 16, 0); // 24 bit color, no alpha, 16
> > bit depth buffer, no stencil buffer
> > getHolder().setFormat(PixelFormat.TRANSLUCENT); // supposedly makes it
> > use 
>
> > On a galaxy s and no dice.
>
> > So my questions are:  Do any devices support high color and if so, is
> > there a good way to use it when available but fall back to 16 bit when
> > not for OpenGL?
>
> > I found this snippet somewhere, but haven't tried doing this in combo
> > with the pixelformat:
>
> > public class MyActivity extends Activity {
> >  @Override
> >  public void onAttachedToWindow() {
> >    super.onAttachedToWindow();
> >    Window window = getWindow();
> >    window.setFormat(PixelFormat.RGBA_);
> >  }
> > }
>
> > Does anyone have experience with this?
>
> > Thanks!
>
> > --
> > 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+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Romain Guy
> Android framework engineer
> romain...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support.  All such questions should be posted on public
> forums, where I and others can see and answer them

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] 24 bit color for GL surface?

2011-03-16 Thread Robert Green
I remember that early Android devices were all 16 bit color (RGB_565)
but read something about 24 bit color support on newer devices?  I'd
like to enable it in a safe way if possible for my surface/pixelformat
for GL but I'm not getting a valid egl config back.

I've tried:

setEGLConfigChooser(8, 8, 8, 0, 16, 0); // 24 bit color, no alpha, 16
bit depth buffer, no stencil buffer
getHolder().setFormat(PixelFormat.TRANSLUCENT); // supposedly makes it
use 

On a galaxy s and no dice.

So my questions are:  Do any devices support high color and if so, is
there a good way to use it when available but fall back to 16 bit when
not for OpenGL?

I found this snippet somewhere, but haven't tried doing this in combo
with the pixelformat:

public class MyActivity extends Activity {
  @Override
  public void onAttachedToWindow() {
super.onAttachedToWindow();
Window window = getWindow();
window.setFormat(PixelFormat.RGBA_);
  }
}

Does anyone have experience with this?

Thanks!

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Yarrr the pirates be on facebook sharin' yer paid apps

2011-03-13 Thread Robert Green
http://www.facebook.com/profile.php?id=1113885654 using site
http://mobilesat.blogspot.com/ to syndicate files from mediafire.

He's posting to all of the device fan pages with links to his site
which is full of commercial APKs for free.  Please report this person
for spam/scam if it affects you and also report the blogspot violation
if possible.

Thanks

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Small game develop

2011-03-10 Thread Robert Green
Have one big custom surface view for your game.  Use canvas to draw
stuff to it.  Keep fields that are the position.  Process input to
change the position.  Draw the ball where the position is on your
surface (using canvas).  See the examples that come with Android SDK
for more info on using surfaceview.

On Mar 9, 10:36 pm, Justin Anderson  wrote:
> * > can anyone give me suggestion ??*
> ummm code?
>
> Thanks,
> Justin Anderson
> MagouyaWare Developerhttp://sites.google.com/site/magouyaware
>
>
>
>
>
>
>
> On Mon, Mar 7, 2011 at 10:11 PM, JackeyChan  wrote:
> > I only want the ball can move with user input: up , down, left,
> > right.
> > now , the ball is created by extend the View class and draw it on the
> > canvas, then set this to be default activity view.
> > but i don't know how to handle user input for re-draw it.
> > can anyone give me suggestion ??
>
> > --
> > 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+unsubscr...@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 post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: opengl textures

2011-02-07 Thread Robert Green
If not mipmapping, you can do rectangular powers of two (512x256,
1024x512) but if using mips, you need to keep it square (256x256,
512x512).

Some devices can do non power of two, but a good rule of thumb is to
always use it.  If you have some reason not to, you can check the
extensions for the NPOT extension and if it's present, you can use any
dimensions under 2k I believe.

On Feb 7, 10:23 am, Marcin Orlowski  wrote:
> On 7 February 2011 19:22, Marcin Orlowski  wrote:
>
> > On 7 February 2011 18:57, bob  wrote:
> >> Do opengl textures on Android have to be a width and height that is a
> >> power of 2?
>
> > In general: yes as some devices will won't handle your textures otherwise.
>
> It applies to width (for quite obvious reasons), yet I am not sure about 
> height
> and can't check now.

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Android SDK is so slow that is ridiculous.

2011-01-29 Thread Robert Green
iOS simulator is fast because XCode builds an X86 binary and because
iPhone and OSX both run basically the same OS, there is no actual
emulation happening, mostly just API mapping... It's running as a
mostly OS-Native binary.

Unless you want to develop your apps in Android itself on your desktop
on an ARM CPU, you should understand that there will be a performance
penalty for emulating the an ARM CPU on x86.  One way to make it
faster is to build an Android x86 emulator and stop emulating
operations, instead using the CPU natively.  It seems as if there is
progress in that area, even if it's not all from Google.

On Jan 29, 11:57 am, Marc Petit-Huguenin  wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> On 01/29/2011 10:55 AM, Leigh McRae wrote:
>
> > It's easy to say that until you have actually written an OpenGL game for
> > Android.  Running at seconds per frame instead of frames per second
> > means you can ONLY test on real hardware.  On real hardware my game
> > (Tank Recon 3D) takes over 5 minutes to load in the debugger (30 seconds
> > on BlackBerry).  Even working with these limitations you also have to
> > develop for the different OS versions and screen sizes.
>
> > Now I understand what you're saying with the emulation but this blanket
> > answer is getting kind of old.  Stop giving the 'You can't get there
> > from here' answer and try and figure something out.  The BlackBerry
> > emulators route the OpenGL calls to the desktop PC and allow you to
> > choose the level of acceleration.  Maybe this is something that can be
> > looked into.  Sure I know you're not getting a 1:1 mapping but it does
> > allows you to develop.  How about making a new driver backed by the
> > desktop GPU and give some way to select it?
>
> And what about you write and contribute this driver to the code base?  There 
> was
> something I disliked in the phone emulator, I fixed it for myself, and then
> submitted it in Gerrit and the patch was accepted, all in less than two months
> and it is now part of Gingerbread.
>
> Complaining about missing features on an open source project is ridiculous.
>
>
>
>
>
>
>
>
>
>
>
> > On 1/29/2011 12:53 PM, Dianne Hackborn wrote:
> >> On Sat, Jan 29, 2011 at 1:26 AM, Miguel Morales
> >> mailto:therevolti...@gmail.com>> wrote:
>
> >>     Not to mention that testing OpenGL games is impossible.  The only way
> >>     to test on devices is users, otherwise it's just a guessing and
> >> hoping
> >>     for the best.
> >>     In any case, I don't care WHY the emulator is so slow.  Hopefully
> >>     they'll make it fast in the near future, the iPhone emulator is much
> >>     better.
>
> >> At the end of the day, you absolutely need to test and run on a
> >> device, especially for doing things like OpenGL games.  An emulator or
> >> simulator on desktop hardware is never going to give you a good idea
> >> of how your app performs on real hardware.
>
> >> This isn't an excuse for the emulator being slow (we really would like
> >> to improve it, this is just a fairly challenging problem), but no
> >> matter what is done it can never be a replacement for running on a
> >> real device.
>
> >> --
> >> Dianne Hackborn
> >> Android framework engineer
> >> hack...@android.com 
>
> >> Note: please don't send private questions to me, as I don't have time
> >> to provide private support, and so won't reply to such e-mails.  All
> >> such questions should be posted on public forums, where I and others
> >> can see and answer them.
>
> >> --
> >> 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+unsubscr...@googlegroups.com
> >> For more options, visit this group at
> >>http://groups.google.com/group/android-developers?hl=en
>
> - --
> Marc Petit-Huguenin
> Personal email: m...@petit-huguenin.org
> Professional email: petit...@acm.org
> Blog:http://blog.marc.petit-huguenin.org
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.10 (GNU/Linux)
>
> iEYEARECAAYFAk1EcS8ACgkQ9RoMZyVa61es6wCeMZHA1Lu5GrzI4qNBIpW/vMQX
> 6NIAn3azdKrV6q6BAurX2sDMwJsEkfMp
> =tUSL
> -END PGP SIGNATURE-

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Best, easiest, cleanest, way to make a game and cross platfrom.

2011-01-25 Thread Robert Green
Let me enter this most holy war with some first hand experience.  I
have under my belt 5 Android-only games and one cross platform Android/
iPhone game.  Want to guess which took the least amount of time
relative to difficulty of game to do?  The fact of the matter is that
once you're good at cross platform programming, you get the advantage
of being able to code/build/test natively in Windows or OSX which
saves a good minute every time over deploying to the device and is
easier overall to do.  Why not use the emulator?  It takes forever and
does not have adequate 3D performance and does not support GLES 2.0.
So I code in Eclipse/CDT, test mostly on Win32 builds then do a daily
or every other day build for Android using NDK r4 (I haven't switched
to 5 yet).  What I test for on Android is scale, usability (controls)
and performance.  Of course if you're heavily multitouched you'll need
more device testing time but often times keyboard bindings and a mouse
can get you around that somewhat for testing on a desktop OS.

Things are working so well for me that I know for certain I will not
be developing any more platform-specific games in Java.  I'm
experiencing serious time savings and the performance I'm getting is
fantastic.  Of course there's a couple of months of code to build up
to be able to do this (and I will be licensing mine soon for anyone
interested who wants to save some time) but once you're over that
hump, it's pure productivity.

On Jan 24, 11:56 am, Phil Endecott 
wrote:
> On Jan 22, 7:27 am, Hogus  wrote:
>
> > People spend way too much time worrying aboutcross-platform
> > capability at the outset.
> > Companies
> > spend so much time trying to roll their product out to everyone that
> > they back themselves into corners where there is no way to actually
> > provide the functionality that they want to provide and end up with
> > some watered down, "me too", application that anyone else could have
> > developed.
>
> This is an interesting viewpoint which I agree with to a certain
> extent.
>
> For me, the main motivation for making my codecross-platformis to
> avoid having all my eggs in one basket.  (The "Apple Basket" in many
> cases.)  Diversity, both across platforms and across apps, reduces the
> risk of some event beyond my control taking away the income that pays
> the rent.
>
> Perhaps the important thing is to at least be aware of your options,
> and to know what technologies arecross-platformand which are not.

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Best, easiest, cleanest, way to make a game and cross platfrom.

2011-01-20 Thread Robert Green
I'm currently writing clean cross platform games in C++.  I'll be
releasing a product very soon that is the foundation of what I'm doing
there.

On Jan 20, 6:16 am, brian purgert  wrote:
> Thanks i looked into it and i really like the unity game engine, and i just
> bought a book for it and i think it will be a good next step for me.
> On Jan 20, 2011 12:06 AM, "Nightwolf"  wrote:
>
>
>
>
>
>
>
> > libgdx allows you to develop mostly on PC and then generate apk for
> > android.
> > Unity engine has iPhone and Android targets. However android version
> > will cost you.
>
> > On Jan 20, 3:30 am, brian purgert  wrote:
> >> Well, I,ve decided that I want to make my next game a diffrent way, after
> >> learning alot, i don't think i want to draw it with the canvas altough
> very
> >> easy for the concept im going with.
> >> So what do you think about "andengine" or "corona sdk" or even straight
> >> opengl i saw a little kid use it to make a game lol, so its probably
> easy,
> >> also i want it to be easy to transfer from platfrom to platfrom.
>
> >> What are my options, your advice..
>
> > --
> > 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+unsubscr...@googlegroups.com > cr...@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 post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: 2D shooting game problem

2011-01-19 Thread Robert Green
It's kind of like what I said.  You're at the point now where you need
to take a step back and look at the big picture before you can move
forward and make things more interesting.

If I were you, my end goal would be to have a design that lets me
write a bit of code that looks like this:

if (spacePressed) {
  bullets.add(new Bullet(turret.x, turret.y, turrent.rotation));
}

It all comes back to the modeling that I'm talking about.  Put the
bullet behavior in a Bullet class, and update all Bullet instances
from your main class.  Bullets are easy, they travel in a direction at
a speed from a given point.  Using code like this, you can have many
bullets in-play easily :)

On Jan 19, 3:50 am, Niksa Lovrinic  wrote:
> Thank you guys and especially Robert,
>
> But the question would be, how do I make that the bullet is fired on a
> single SPACE key press from the turret to the end of the screen?
>
> That's my problem.
>
> Nick
>
>
>
>
>
>
>
> On Wed, Jan 19, 2011 at 7:16 AM, Kevin Duffey  wrote:
> > Or read Robert's post.. follow his blog, follow the links. He has a ton of
> > good info on there. As I am finding out, game development is not for the
> > faint of heart. It takes years to become really good at it and understand
> > all the ins and outs. Thankfully we have people like Robert and some others
> > that are willing to share their processes, problems and even code to help us
> > out!
>
> > On Tue, Jan 18, 2011 at 7:00 PM, Zsolt Vasvari  wrote:
>
> >> If I recall correctly, LunarLander is not exactly the best example of
> >> game design for Android.
>
> >> If I were to create an Android game, I'd start with the source of
> >> Replica Island.
>
> >> On Jan 17, 12:37 am, Niksa Lovrinic  wrote:
> >> > Hello everybody,
>
> >> > I've been playing with the LunarLander example and tried to make my own
> >> > thing out of it...
>
> >> > On the right bottom screen, I've got a tank that is not moving and his
> >> > turret that's moving up and down. It's supposed to shoot missiles at
> >> > different angles.
>
> >> > I've got a tank, turret and a bullet and they are a Bitmap image.
>
> >> > private Bitmap tank;
> >> > private Bitmap turret;
> >> > private Bitmap bullet;
>
> >> > Turret only rotates from angle 0 to angle 75, and I did that with the
> >> > update...
>
> >> > I managed to get the turret moving but now I'm finding it hard to shoot
> >> > missiles.
>
> >> > *doDraw method*
> >> > *
> >> > *
> >> > private void doDraw(Canvas canvas) {
>
> >> >          canvas.drawBitmap(backgroundImage, 0, 0, null);
>
> >> >          canvas.drawBitmap(tank, x_tank, y_tank, new Paint());
>
> >> > //Rotating the turret
> >> >          canvas.rotate((float) mHeading, (float) x_turret +
> >> mTurretWidth,
> >> > y_turret);
>
> >> >          canvas.drawBitmap(turret, x_turret, y_turret, new Paint());
>
> >> > ??? what should I write here for the bullet to be seen shooting out of
> >> that
> >> > turret
>
> >> >         }
>
> >> > *Update method*
> >> > *
> >> > *
> >> > private void updateGame() {
>
> >> >             long now = System.currentTimeMillis();
>
> >> >             if (mLastTime > now)
> >> >              return;
> >> >             double elapsed = (now - mLastTime) / 1000.0;
>
> >> >             if (dUp) // UP key
> >> >              mHeading += 1 * (PHYS_SLEW_SEC * elapsed);
>
> >> >             if (mHeading >= 75) mHeading = 75;
>
> >> >             if (dDown) // DOWN key
> >> >               mHeading += (-1) * (PHYS_SLEW_SEC * elapsed);
> >> >          if (mHeading < 0) mHeading = 0;
>
> >> >             i
> >> > f (dSpace){
>
> >> >          // Fire bullet SPACE key
> >> >                         ??? what should I write here for the bullet to
> >> be
> >> > seen shooting out of that turret
> >> >                          ??? When is the method doDraw being called??
>
> >> >             }
>
> >> >          m
> >> > LastTime = now;
>
> >> >         }
>
> >> > Thank you so much guys,
>
> >> > Nick
>
> >> > *
> >> > *
> >> > *
> >> > *
>
> >> --
> >> 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+unsubscr...@googlegroups.com >>  cr...@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 post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com > cr...@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 post to this group, send

[android-developers] Re: 2D shooting game problem

2011-01-18 Thread Robert Green
Model your world.  Try this:

public class GameObject {
  public float x,y;
  public Bitmap bmp;
}

public class Tank extends GameObject {
  // do tank stuff
}

public class Bullet extends GameObject {
  // do bullet stuff
}

See where I'm going there?  Then in your main game class you just keep
a list of the gameobjects, run through and update them.  Check out
this article I wrote when I was doing light racer 3d -
http://www.rbgrn.net/content/215-light-racer-3d-development-journal

Scroll down on that page to the end where all of the book pages are
linked.  Read through the first few.  I show how games like that are
designed on the inside so you can use that information to do yours.

On Jan 16, 8:37 am, Niksa Lovrinic  wrote:
> Hello everybody,
>
> I've been playing with the LunarLander example and tried to make my own
> thing out of it...
>
> On the right bottom screen, I've got a tank that is not moving and his
> turret that's moving up and down. It's supposed to shoot missiles at
> different angles.
>
> I've got a tank, turret and a bullet and they are a Bitmap image.
>
> private Bitmap tank;
> private Bitmap turret;
> private Bitmap bullet;
>
> Turret only rotates from angle 0 to angle 75, and I did that with the
> update...
>
> I managed to get the turret moving but now I'm finding it hard to shoot
> missiles.
>
> *doDraw method*
> *
> *
> private void doDraw(Canvas canvas) {
>
>          canvas.drawBitmap(backgroundImage, 0, 0, null);
>
>          canvas.drawBitmap(tank, x_tank, y_tank, new Paint());
>
> //Rotating the turret
>          canvas.rotate((float) mHeading, (float) x_turret + mTurretWidth,
> y_turret);
>
>          canvas.drawBitmap(turret, x_turret, y_turret, new Paint());
>
> ??? what should I write here for the bullet to be seen shooting out of that
> turret
>
>         }
>
> *Update method*
> *
> *
> private void updateGame() {
>
>             long now = System.currentTimeMillis();
>
>             if (mLastTime > now)
>              return;
>             double elapsed = (now - mLastTime) / 1000.0;
>
>             if (dUp) // UP key
>              mHeading += 1 * (PHYS_SLEW_SEC * elapsed);
>
>             if (mHeading >= 75) mHeading = 75;
>
>             if (dDown) // DOWN key
>               mHeading += (-1) * (PHYS_SLEW_SEC * elapsed);
>          if (mHeading < 0) mHeading = 0;
>
>             i
> f (dSpace){
>
>          // Fire bullet SPACE key
>                         ??? what should I write here for the bullet to be
> seen shooting out of that turret
>                          ??? When is the method doDraw being called??
>
>             }
>
>          m
> LastTime = now;
>
>         }
>
> Thank you so much guys,
>
> Nick
>
> *
> *
> *
> *

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Anyone with GL experience willing to take a contract/bounty?

2011-01-17 Thread Robert Green
There are many Android devs who have plenty of GL experience, however
I believe that your post was too vague to draw interest.

I believe many of the good game developers have stopped watching this
group because it has become rather large and generally has little to
offer graphics and simulation programmers, who are your targets.

You would have more luck IMO searching this group for GL-related
topics and emailing those directly who seem to have knowledgeable
questions and replies.

On Jan 17, 8:38 am, Brill Pappin  wrote:
> Thanks, I'll give that a try.
>
> I'm not surprised the GL knowledge pool  is small, its a whole different 
> beast... which is exactly why we want to framework work done... it will let 
> us accelerate our experimentation and maybe actually get something to market 
> in the black rather than in the red :)
>
> - Brill Pappin
>
> On 2011-01-17, at 11:01 AM, TreKing wrote:
>
>
>
>
>
>
>
> > On Mon, Jan 17, 2011 at 9:52 AM, Brill Pappin  wrote:
> > Really? Nobody is interested in this at all?
>
> > Not surprised. People here probably have their own projects going on I get 
> > the impression that the knowledge pool for GL on Android is very small.
>
> > Maybe try gamedev.net - great site for general game development stuff and 
> > they have a Help Wanted section.
>
> > --- 
> > --
> > TreKing - Chicago transit tracking app for Android-powered devices
>
> > --
> > 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+unsubscr...@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 post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Eclipse/ADT just not cutting it, need refined ide For androdi development!

2011-01-14 Thread Robert Green
I wish I could have every eclipse naysayer sit by me and pair
program.  I've never had an IDE that I can burn through code so
efficiently in every way.  In fact, they do have UX experts working on
it.  It's gotten very good, but like any big IDE, you need to know
lots of details to make use of that.  It comes with years of
experience.  Just keep trying, ask questions and you'll get better
with it.

On Jan 14, 9:26 am, Kostya Vasilyev  wrote:
> Using Eclipse on Windows 7 / 64 bit here just fine, and very happy with it
> overall.
>
> Automatic rebuilds occasionally lag a little (i7 860, 4G RAM), but then it's
> a small price to pay for not having to think about a separate build step.
>
> My favorite feature is refactoring, I like how easy it is to rename things
> (to improvide code clarity).
>
> Second fave is source formatting (and XML formatting too, now that I've
> learned how to make it put each attribute on a separate line).
>
> And various ways to navigate the code are great too - like jumping to the
> definition of a variable or a class, or jumping between all classes that
> implement / override a particular method.
>
> Can't say anything about the layout editor - I only use it for previewing,
> and not often.
>
> -- Kostya
>
> 2011/1/14 Brill Pappin 
>
>
>
>
>
>
>
> > I can't say I agree.
> > I like working in Eclipse and it supports *every* type of project that
> > I might want to combine to make a product.
>
> > The ADT could be a bit more responsive sometimes but I haven't had a
> > lot of problems with it and I would really not want a whole new IDE to
> > do my development in.
>
> > Maybe I'm having a good experience because i develop on a Mac... but I
> > can't really credit that as the reason.
>
> > So, I for one would not be pleased if this IDE was not supported any
> > more. I'm very much looking forward to the future and integration with
> > the new Eclipse 4 as it becomes mainstream.
>
> > -Brill Pappin
>
> > BTW - If you want formatting, learn your tools. Eclipse can do it for
> > you on every save.
>
> > On Jan 7, 10:01 pm, indigo0086  wrote:
> > > I mean right now it's the only IDE for developing for android
> > > "efficiently".  I'm just finding that eclipse and adt are just barely
> > > usable tools for android development (more eclipse than ADT of
> > > course).  I've read where a few android developers have complained
> > > that the tools have poor usability, are slow, and are just not
> > > visually pleasing to use.  I can site the android layout editor
> > > horribly formats xml, and eclipse doesn't automatically format it when
> > > switching to xml edit view.  I think we need official tools solely for
> > > android development instead of a plugin for an ide developed by the
> > > community (none of which seem to be user experience experts either).
> > > I just feel like it's a chore to develop in java as opposed to in
> > > other languages mainly because of the ide tools available.
>
> > --
> > 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+unsubscr...@googlegroups.com > cr...@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 post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: 2D game BallBraker

2011-01-12 Thread Robert Green
First of all, you will not have that working in 5 days if this is your
first game.  Any one little thing will get you hung up and you'll
slip.  You will need much more time than that to get acquainted with
game development.

I published an article here about android game development -
http://www.rbgrn.net/content/54-getting-started-android-game-development
Mario Zechner has lots of great info for beginning game development at
his blog - http://www.badlogicgames.com/wordpress/

On Jan 12, 1:01 am, Abhishek Talwar 
wrote:
> Hey guys
> I have to make the game like this 
> :-http://www.1980-games.com/us/action-games/block-breaker/ballbraker.php
> I have to make this in 5 days and i have no idea how to make a game.
> Even tiny help will be appreciated

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Android NDK

2011-01-06 Thread Robert Green
Where to start?

1)  Read the documentation.  http://developer.android.com/sdk/ndk/index.html
2)  Ask on the right mailing list.  http://groups.google.com/group/android-ndk
3)  Get replies publicly so that the information can help other
people.  Asking to have people personally email you answers does not
help others in the same boat.

You provided no information for anyone to help so I'm guessing you are
in windows.  Install cygwin, do what the documentation says, enjoy
your shared object binary.

On Jan 6, 10:14 pm, Rocky  wrote:
> Hi,
>
> but i'm not able to run make command.
>
> can u give me step by step procedure upto this point
>
> u can send me at rkjhaw1...@gmail.com
>
> thanks in advance..
>
> On Wed, Dec 29, 2010 at 3:13 PM, Anshuman Tripathi <
>
>
>
>
>
>
>
>
>
> anshuman.tripat...@gmail.com> wrote:
> > I am new guy for android. I am trying to use NDK in my Test Project.
> > After getting MAKE APP successfully. I will get .so file but when I
> > started my Test project
> > its not able to load the file. It showing the error like "unsatisfied
> > link error" .
>
> > logcat message like
>
> > : >> AndroidRuntime START <<
> > D/AndroidRuntime(  275): CheckJNI is ON
> > D/AndroidRuntime(  275): --- registering native functions ---
> > I/ActivityManager(   65): Starting activity: Intent
> > { act=android.intent.action.MAIN
> > cat=[android.intent.category.LAUNCHER] flg=0x1000
> > cmp=cem.net.NDKDem/.NDKDem }
> > D/AndroidRuntime(  275): Shutting down VM
> > I/AndroidRuntime(  275): NOTE: attach of thread 'Binder Thread #3'
> > failed
> > D/jdwp    (  275): adbd disconnected
> > W/ActivityManager(   65): Activity pause timeout for
> > HistoryRecord{43fa6198 com.android.launcher/
> > com.android.launcher2.Launcher}
> > I/ActivityManager(   65): Start proc cem.net.NDKDem for activity
> > cem.net.NDKDem/.NDKDem: pid=282 uid=10036 gids={}
> > W/dalvikvm(  282): Exception Ljava/lang/UnsatisfiedLinkError; thrown
> > during Lcem/net/NDKDem/NativeLib;.
> > D/AndroidRuntime(  282): Shutting down VM
> > W/dalvikvm(  282): threadid=1: thread exiting with uncaught exception
> > (group=0x4001d800)
> > E/AndroidRuntime(  282): FATAL EXCEPTION: main
> > E/AndroidRuntime(  282): java.lang.ExceptionInInitializerError
> > E/AndroidRuntime(  282):        at
> > cem.net.NDKDem.NDKDem.onCreate(NDKDem.java:21)
> > E/AndroidRuntime(  282):        at
> > android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
> > 1047)
> > E/AndroidRuntime(  282):        at
> > android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
> > 2627)
> > E/AndroidRuntime(  282):        at
> > android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
> > 2679)
> > E/AndroidRuntime(  282):        at android.app.ActivityThread.access
> > $2300(ActivityThread.java:125)
> > E/AndroidRuntime(  282):        at android.app.ActivityThread
> > $H.handleMessage(ActivityThread.java:2033)
> > E/AndroidRuntime(  282):        at
> > android.os.Handler.dispatchMessage(Handler.java:99)
> > E/AndroidRuntime(  282):        at android.os.Looper.loop(Looper.java:123)
> > E/AndroidRuntime(  282):        at
> > android.app.ActivityThread.main(ActivityThread.java:4627)
> > E/AndroidRuntime(  282):        at
> > java.lang.reflect.Method.invokeNative(Native Method)
> > E/AndroidRuntime(  282):        at
> > java.lang.reflect.Method.invoke(Method.java:521)
> > E/AndroidRuntime(  282):        at com.android.internal.os.ZygoteInit
> > $MethodAndArgsCaller.run(ZygoteInit.java:868)
> > E/AndroidRuntime(  282):        at
> > com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
> > E/AndroidRuntime(  282):        at dalvik.system.NativeStart.main(Native
> > Method)
> > E/AndroidRuntime(  282): Caused by: java.lang.UnsatisfiedLinkError:
> > Library ndk_dem not found
> > E/AndroidRuntime(  282):        at
> > java.lang.Runtime.loadLibrary(Runtime.java:461)
> > E/AndroidRuntime(  282):        at
> > java.lang.System.loadLibrary(System.java:
> > 557)
> > E/AndroidRuntime(  282):        at
> > cem.net.NDKDem.NativeLib.(NativeLib.java:6)
> > E/AndroidRuntime(  282):        ... 14 more
> > W/ActivityManager(   65):   Force finishing activity
> > cem.net.NDKDem/.NDKDem
> > W/ActivityManager(   65): Activity pause timeout for
> > HistoryRecord{43e3b3b8 cem.net.NDKDem/.NDKDem}
> > I/ActivityManager(   65): Displayed activity com.android.launcher/
> > com.android.launcher2.Launcher: 108535 ms (total 108535 ms)
> > W/ActivityManager(   65): Activity destroy timeout for
> > HistoryRecord{43e3b3b8 cem.net.NDKDem/.NDKDem}
> > D/KeyguardViewMediator(   65): pokeWakelock(5000)
> > I/ARMAssembler(   65): generated
> > scanline__0077:03515104__ [ 33 ipp] (47 ins) at
> > [0x330a80:0x330b3c] in 3010726 ns
> > I/Process (  282): Sending signal. PID: 282 SIG: 9
> > I/ActivityManager(   65): Process cem.net.NDKDem (pid 282) has died.
> > I/ARMAssembler(   65): generated
> > scanline__0177:03515104_1

[android-developers] Re: Converting Touch Inputs to Vectors

2010-12-30 Thread Robert Green
Define a minimum distance, say 10 dips.
Make or use a Vector2D class. (just x and y)
Allocate an array for your Vector2Ds.

pseudocode:
onPointerMoved() {
  if (points.size() == 0) {
points.add(new Vector2d(pointerx, pointery));
  } else {
Vector2D lastpoint = points.get(points.size() - 1);
if (distancefrom(lastpoint, pointerx, pointery) >
minimum_distance) {
  points.add(new Vector2d(pointerx, pointery));
}
  }
// analyze points here if you want to do it while user still moving
}

This will plot points as the user moves around, given a precision of
the minimum size you define.  You can analyze the points while the
pointer is moving or you can wait until they let the pointer up and
then analyze.  Checking for a direction of a vector is easy, it's
atan2((point0.x - point1.x) / (point0.y - point1.y)) but making more
sense of the graph becomes a bit more mathy.

Curve or arc recognition could be done in hackerish form by analyzing
4 or 5 points at a time (depending on precision, of course) and
calculating the average direction, min and max direction and minmax
direction delta then using those to decide what kind of arc it is and
mostly in what direction it was going.

So this is the "how," but without knowing more about exactly what
you're trying to do, this is all I can offer.

On Dec 30, 8:53 am, Paul  wrote:
> On Dec 30, 5:09 am, Daniel Drozdzewski 
> wrote:
>
>
>
>
>
>
>
>
>
> > > On Dec 29, 1:18 am, Paul  wrote:
> > >> Hi all.  I am writing an app that will convert touchscreen user inputs
> > >> (such as the user 'handwriting' on the screen) into vectors that can
> > >> then be saved and recalled later.  I need to get the vectors into a
> > >> format I can store locally, either as a file or in an SQLite
> > >> database.  Just wondering if anyone had any pointers as to how to get
> > >> started...  my initial thought was to listen for MotionEvents and when
> > >> an ACTION_DOWN is detected, record the coordinates and use this as the
> > >> vector's start point, and then record intermediate coordinates as the
> > >> ACTION_MOVE is triggered (used to help define the shape of this Path
> > >> they are creating), ending the stroke vector on ACTION_UP... but this
> > >> results in many many intermediate points per vector (30 or 40) and
> > >> with several hundred vectors (a full page of handwritten text on a
> > >> tablet for example) this solution gets quickly out of hand as each
> > >> page will potentially require tens of thousands of points...
>
> > >> Any suggestions on a better way to represent and store user-inputed
> > >> vectors/paths?  Or maybe another approach completely?
>
> > >> Thanks for any help!
>
> > >> Paul
>
> > Paul,
>
> > You could blindingly start filtering any intermediate vectors, but you
> > would miss some important points, where the writing drastically
> > changes its direction.
> > As you see, the problem you have is detecting where the continuous
> > line changes its direction by much and intermediate points could be
> > filtered.
>
> > You would need calculating the angles between adjacent vectors and
> > when the angle gets bigger than some threshold value, the point
> > between said vectors becomes very important.
>
> > Hope this helps you somehow.
>
> > --
> > Daniel Drozdzewski
>
> I was thinking about this issue too... how do I recognize when a path
> backs onto itself, makes sharp turns, etc as is normal in
> handwriting?  As I mentioned in another reply, I have looked at the
> SVG Path standard:
>
> http://www.w3schools.com/svg/svg_path.asp
>
> Looks like a possibility in terms of efficiently storing the shape of
> the stroke, but to use it I need to somehow take a set of coordinate
> points that Android spits out from MotionEvent and 'recognize' when it
> is a curve, arc, etc...  maybe I extend my StrokeGestureDetector I
> mentioned to handle the heavy lifting of this recognitions, so that it
> simply reports back when the stroke is curved, etc?  The issue remains
> how I determine when a set of x,y coords forms a curve, a sharp curve
> (such as when printing an M for example), etc.  Off the top of my
> head, maybe in my gesture detector, when in a stroke, store the last 3
> MotionEvent points, generate a 'line' from point 1 to 2, and point 2
> to 3 and determine the angle at this vertex to help recognize
> direction changes?  Again, the HOW is where I am stuck at this
> point...  once I have the points described, recreating looks straight-
> forward simple using the built-in Path class.
>
> Any ideas on how to programatically test for the direction changes,
> curves, etc?
>
> Paul

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Cross Word Game

2010-12-27 Thread Robert Green
Important decisions to make are:

1)  Is this just for Android or are you targeting more systems?
2)  Do you need a performance component, like a real time puzzle
solver or random puzzle game creator?
3)  Do you want fancy graphics or is something really basic going to
work?

If #1 = Only Android and #2 = No and #3 = No then consider going with
this solution:

A)  All Java
B)  Mostly off-the-shelf Android UI Components
C)  Custom view for your gameboard (This is hard to escape from and is
often easier than trying to build it all using android layouts and
widgets)
C1)  Just use Canvas for your 2D lib and all will be easy and well.

Cheers

On Dec 27, 1:11 pm, ko5tik  wrote:
> On Dec 27, 6:35 pm, "Diego N."  wrote:
>
> > I would like to develop a crossword puzzle game but never worked with game
> > development. He wanted to know where to start.
>
> > I will use Java 2D?
>
> I would recommend to stick to standard android widgets if you do not
> need realtime
> graphics (which is the case with crossword puzzle game) - but full UI
> power including layout and
> animations.
>
> If you need realtime frame rendering your choice is SurfaceView and
> drawing into bitmaps with android
> toolkit  - or maybe even with GL if hardware acceleration if available
>
> regards,

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: OpenGL Problem with Sphere Texture Mapping

2010-12-27 Thread Robert Green
Well said Kostya.

Pedro - I defined the formula to get your normal above.  A normal is a
unit vector (a 3D vector of length 1.)  Each vertex must have a normal
for proper shading, as that's how light is calculated.  The normal of
a vertex of a sphere is a easy to calculate.  Think of it as the
direction from the center of the sphere through the vertex.  That's
your vector.  I provided a formula, though you'll have to javafy it a
little to make that work for you.  If you're struggling to understand
this, I suggest reading some 3D primer books before moving on.  They
are very, very helpful.

Cheers

On Dec 27, 7:59 am, Kostya Vasilyev  wrote:
> Pedro,
>
> A normal is a unit vector (length == 1) that is perpendicular to the
> surface. Normals are used for shading, so don't worry about them too
> much for now.
>
> Texture coordinates, as was already pointed out here, are in 2D space,
> i.e. two coordinates. The reason is that textures are 2-dimensional, and
> texture coordinates specify which point within the texture should be
> mapped to a particular vertex in 3D space.
>
> Imagine that the texture is a stretchable, initially square, piece of
> fabric. Each UV coordinate represents a point within that square.
>
> For each vertex, the point within the texture specified for that vertex
> by UV coordinates is "glued" to the vertex. Then the texture is allowed
> to stretch between vertexes.
>
> What sort of texture coordinates you generate is entirely up to you.
>
> A simple way to texture map a sphere is to wrap the texture into a
> vertical cylinder around the sphere, then pull the top and bottom
> towards the sphere, so you have singularities at the top and bottom of
> the sphere.
>
> If you generate your sphere as a bunch of horizontal bands, each having
> equal angular size, and further subdivided around into equal patches,
> then you can your use loop variables (band / patch index) to compute UV
> coordinates. Just remember that UV are 0 to 1 (unless you want tiling).
>
> -- Kostya
>
> 27.12.2010 18:35, pedr0 пишет:
>
>
>
>
>
>
>
>
>
> > But normal.x what is it?
>
> > Is the abs(x) ?
>
> > On 23 Dic, 20:41, Robert Green  wrote:
> >> UV unwrapping/mapping is standard practice in 3d games.  It's how the
> >> artist lines up the textures onto the skin/model.
>
> >> You're doing UV coordinate generation, which is similar but is
> >> mathematically specified instead of placed by a 3D modeling
> >> application.
>
> >> On Dec 23, 12:37 am, pedr0  wrote:
>
> >>> What do you think about it?
> >>>http://en.wikipedia.org/wiki/UV_mapping
> >>> On 23 Dic, 09:19, pedr0  wrote:
> >>>> Thanks a lot,
> >>>> especially at Robert Green for his very good explanation!
> >>>> The absurd thing is that the code which I posted above is 100% right
> >>>> in a iPhone iOS, but when I port the same code on the Android platform
> >>>> I have these issues.
> >>>> I will try to do what you are talking about normals and I let you know
> >>>> about my progress!
> >>>> Thanks again.
> >>>> pedr0
> >>>> On 23 Dic, 04:10, Mario Zechner  wrote:
> >>>>> On 22 Dez., 20:42, Robert Green  wrote:
> >>>>>> 3DVec normal = (sphereCenter - point).normalize();
> >>>>> 3DVec normal = (point - sphereCenter).normalize();
> >>>>> Or your world will be upside down. Unless my brain is totally
> >>>>> borked :) (could well be, 4am here...)
>
> --
> Kostya Vasilyev -- WiFi Manager + pretty widget 
> --http://kmansoft.wordpress.com

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: OpenGL Problem with Sphere Texture Mapping

2010-12-23 Thread Robert Green
UV unwrapping/mapping is standard practice in 3d games.  It's how the
artist lines up the textures onto the skin/model.

You're doing UV coordinate generation, which is similar but is
mathematically specified instead of placed by a 3D modeling
application.

On Dec 23, 12:37 am, pedr0  wrote:
> What do you think about it?
>
> http://en.wikipedia.org/wiki/UV_mapping
>
> On 23 Dic, 09:19, pedr0  wrote:
>
>
>
>
>
>
>
> > Thanks a lot,
> > especially at Robert Green for his very good explanation!
>
> > The absurd thing is that the code which I posted above is 100% right
> > in a iPhone iOS, but when I port the same code on the Android platform
> > I have these issues.
>
> > I will try to do what you are talking about normals and I let you know
> > about my progress!
>
> > Thanks again.
>
> > pedr0
>
> > On 23 Dic, 04:10, Mario Zechner  wrote:
>
> > > On 22 Dez., 20:42, Robert Green  wrote:
>
> > > > 3DVec normal = (sphereCenter - point).normalize();
>
> > > 3DVec normal = (point - sphereCenter).normalize();
>
> > > Or your world will be upside down. Unless my brain is totally
> > > borked :) (could well be, 4am 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@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: OpenGL Problem with Sphere Texture Mapping

2010-12-22 Thread Robert Green
Oh here is a faster method - http://www.mvps.org/directx/articles/spheremap.htm

For each point (Assuming Y=up):

3DVec normal = (sphereCenter - point).normalize();
float U = asin(normal.x)/PI + 0.5
float V = asin(normal.y)/PI + 0.5

for z=up:
float U = asin(normal.x)/PI + 0.5
float V = asin(normal.z)/PI + 0.5

But in your code example I don't know if you were calculating normals
correctly.  Your normal should be a vector pointing from the center of
your sphere out the vertex, which is done by subtracting and then
normalizing to make it a unit-vector.

On Dec 22, 11:33 am, Robert Green  wrote:
> pedro,
>
> your problem has nothing to do with android.  I think you may need a
> 3D refresher to solve it.  Normals are not UVs.  Your UVs will depend
> on how you want to map, but the easiest way to do it is to map from
> the sphere center out using angles, like this.  Since GL has 2D
> texture coordinate 0,0 as upper left, you will want to define where
> upper left is on your sphere.  I'd use straight up and center as a
> unit vector, or (0, 0, 1) if z is up in your world.  If y is up, then
> (0,1,0) will be 0,0 in UVs.
>
> so starting with that, you can calculate the UV of any point by
> getting the difference of angle of that starting angle and the new
> point.  Remember that if they both come from the sphere center, you'll
> have complete 2PI radian coverage on both axis... so naturally
> dividing the resulting angle by 2PI will give you a UV number between
> 0 and 1.
>
> The process is like this (assuming z=up)
>
> For each point:
> // for U just look at the sphere from overhead
> U = (atan2(point.x - center.x, point.y - center.y) + PI) / (2PI)
> hyp = distance(point, center);
> V = ((point.z - center.z) / hyp) + 1) / 2
>
> I believe that is correct and there will be a more elegant way to do
> it but today my head is in 2D math world so I can't remember how to
> dot it out.  The idea though is that for every point, you can
> determine the angle needed for U by looking at the sphere from
> overhead and just using an arctan of the xy differences (assuming
> z=up) of the center to the point.  The resulting range is in radians (-
> PI to PI) so you have to add PI to change it from 0 to 2PI and then
> dividing by 2PI gives you 0 to 1.  Then for the V value, you can just
> examine the "height" (z) of the point and in conjunction with its
> distance from the center, you've got an opposite over hypotenuse which
> is the same as the sine of the angle, which is what you want to get a
> evenly distributed texture top to bottom.  The number will also be
> ranged from -1 to 1 so you need to add 1 and divide it by 2 to get the
> 0 to 1 range.  The texture should touch in the corners and if you use
> the right one, look seamless.
>
> If any of my math is wrong, please correct it after debugging, but at
> least this should get you going in the right direction.
>
> Cheers
>
> On Dec 22, 9:09 am, pedr0  wrote:
>
>
>
>
>
>
>
> > Please see the link and reply inside  this post if you have not an
> > account on OpenGL forum, the question is over there.
>
> >http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&N...
>
> > Thanks a lot.

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: OpenGL Problem with Sphere Texture Mapping

2010-12-22 Thread Robert Green
Also I should add that your sphere normal should be (sphereCenter -
point).Normalize() and will be a 3D vector.  Normals are 3D, UVs are
2D.

On Dec 22, 9:09 am, pedr0  wrote:
> Please see the link and reply inside  this post if you have not an
> account on OpenGL forum, the question is over there.
>
> http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&N...
>
> Thanks a lot.

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: OpenGL Problem with Sphere Texture Mapping

2010-12-22 Thread Robert Green
pedro,

your problem has nothing to do with android.  I think you may need a
3D refresher to solve it.  Normals are not UVs.  Your UVs will depend
on how you want to map, but the easiest way to do it is to map from
the sphere center out using angles, like this.  Since GL has 2D
texture coordinate 0,0 as upper left, you will want to define where
upper left is on your sphere.  I'd use straight up and center as a
unit vector, or (0, 0, 1) if z is up in your world.  If y is up, then
(0,1,0) will be 0,0 in UVs.

so starting with that, you can calculate the UV of any point by
getting the difference of angle of that starting angle and the new
point.  Remember that if they both come from the sphere center, you'll
have complete 2PI radian coverage on both axis... so naturally
dividing the resulting angle by 2PI will give you a UV number between
0 and 1.

The process is like this (assuming z=up)

For each point:
// for U just look at the sphere from overhead
U = (atan2(point.x - center.x, point.y - center.y) + PI) / (2PI)
hyp = distance(point, center);
V = ((point.z - center.z) / hyp) + 1) / 2

I believe that is correct and there will be a more elegant way to do
it but today my head is in 2D math world so I can't remember how to
dot it out.  The idea though is that for every point, you can
determine the angle needed for U by looking at the sphere from
overhead and just using an arctan of the xy differences (assuming
z=up) of the center to the point.  The resulting range is in radians (-
PI to PI) so you have to add PI to change it from 0 to 2PI and then
dividing by 2PI gives you 0 to 1.  Then for the V value, you can just
examine the "height" (z) of the point and in conjunction with its
distance from the center, you've got an opposite over hypotenuse which
is the same as the sine of the angle, which is what you want to get a
evenly distributed texture top to bottom.  The number will also be
ranged from -1 to 1 so you need to add 1 and divide it by 2 to get the
0 to 1 range.  The texture should touch in the corners and if you use
the right one, look seamless.

If any of my math is wrong, please correct it after debugging, but at
least this should get you going in the right direction.

Cheers

On Dec 22, 9:09 am, pedr0  wrote:
> Please see the link and reply inside  this post if you have not an
> account on OpenGL forum, the question is over there.
>
> http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&N...
>
> Thanks a lot.

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Bitmap Matrix Rotate

2010-12-22 Thread Robert Green
No.  Load it once and reuse it, otherwise you will suffer some nasty
performance.

On Dec 22, 10:35 am, nirm  wrote:
> Hello,
>
> I have a bitmap that i want it to rotate all the time.
> This bitmap is placed in a SurfaceView.
> My question is: Do i have to create the bitmap every time i want it to
> rotate?
>
> here is my code it is placed is the on draw method:
>
> leftMatrix.setRotate(degrees++, coords.getX()+bitmap.getWidth()/2,
> coords.getY());
>
>                 graphic.setBitmap(Bitmap.createBitmap(bitmap, 0, 0,
> bitmap.getWidth(), bitmap.getHeight(), leftMatrix, false));
> canvas.drawBitmap(bitmap, coords.getX(), coords.getY(), null);
>
> Kind Regards
> Nir

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: openGL ES animation rendering is coming out choppy

2010-12-13 Thread Robert Green
For first gen devices, 20,000 triangles is way too many to get a good
framerate.  I found that anything over about 2500 becomes a burden for
them.  New devices should be able to handle 20k much better.

What device are you testing on?

On Dec 13, 3:27 pm, Avtar Khalsa  wrote:
> Hi All
>
> I am an Android beginner working with openGL ES to try to make some
> simple 3d animations. I only have one glDrawElements call per screen
> refresh and I have it set to RENDERMODE_CONTINUOUSLY. Unfortunately,
> for some reason, my animation is coming out very choppy with a frame
> rate of around 2FPS. I am drawing about 20,000 triangles, but I would
> think that is not too many considering some of the complex things you
> can render. I would be happy to post my code if anyone has any
> thoughts on why the animation might be so choppy? Thanks in advance
>
> Avtar

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Can only see 8 of 13 apps in market console still

2010-11-30 Thread Robert Green
Has anyone had this issue resolved yet?  My company has a total of 13
published apps but I can only see 8 still with no pagination links or
any of that.  The age ratings showed up today but I still have to
punch in package names in URLs to edit apps.

Thanks

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Market is completely out of order !!

2010-11-29 Thread Robert Green
I'm still stuck on page 1 (8 apps in alphabetical order) with no
pagination links so the only way I can modify my other apps is via the
URL.

On Nov 25, 10:34 am, Bradley Brown  wrote:
> Have you tried to go to your account (checkout.google.com)?  I went there
> and got more information...but I'm still waiting on a LOT of answers from
> Google.  I just "LOVE" how they go out to lunch on us...
>
>
>
>
>
>
>
> On Thu, Nov 25, 2010 at 10:13 AM, niko20  wrote:
> > UGH THIS IS BULLSH*T, on a holiday, we want to upload new versions to
> > get lots of new business, and the market is screwed up again!
>
> > -niko
>
> > On Nov 25, 10:07 am, Rob Franz  wrote:
> > > Any idea when this might be fixed?  I can confirm the same problems for
> > me -
> > > half of my listings are gone.  I know it's Thanksgiving and all but this
> > > affects a lot of people, apparently.
>
> > > On Thu, Nov 25, 2010 at 9:15 AM, Sarwar Erfan 
> > wrote:
> > > > May be Google is not paying him well? :D
>
> > > > On Nov 25, 7:55 pm, Yahel  wrote:
> > > > > No news from the Android team(one-man team most probably : ) about
> > the
> > > > > market being completely screwed and unusable :
>
> > > > > - Half my app do not appear anymore in the list
> > > > > - Delete links under the screenshots don't work anymore
> > > > > - Even though there is a highres icon present and showing, saving
> > > > > sends error "This field is required"
>
> > > > > I mean ok, Mister Market Developer you are alone in your office doing
> > > > > the job of a complete team but come on, Unit Testing before launching
> > > > > new version is the bare minimum.
>
> > > > > We know google isn't helping you much and there not giving you even
> > an
> > > > > assistant but last count from july gives 10199 developers using the
> > > > > Market console. That's a lot of people depending on you. Could you
> > try
> > > > > a little harder please ??
>
> > > > > Yahel
>
> > > > --
> > > > 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+unsubscr...@googlegroups.com > > >  cr...@googlegroups.com>
> >  > nsubscr...@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 post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com > cr...@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 post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Apps missing in publisher console

2010-11-24 Thread Robert Green
I'm glad it's not just me!

On Nov 24, 1:25 pm, Kumar Bibek  wrote:
> Haha, Quite a few things there...
>
> >>Will you even be able to log in?
>
> This one is classy. In that case, we might also have trouble logging into
> Gmail. :D
>
> Kumar Bibekhttp://techdroid.kbeanie.comhttp://www.kbeanie.com
>
>
>
>
>
>
>
> On Thu, Nov 25, 2010 at 2:49 AM, TreKing  wrote:
> > On Wed, Nov 24, 2010 at 3:10 PM, Kumar Bibek  wrote:
>
> >> Might be a side-effect. :D
>
> > Indeed - the process for updating the Android Market usually involves
> > adding one new thing and breaking several other existing components.
> > It's turned into a unpredictable game of "What will they break THIS time!?"
>
> > Will your download stats stop moving?
> > Will your install percentage plummet and never return?
> > Will your apps disappear?
> > Will you even be able to log in?
> > Will you be unable to publish / update?
>
> > Who knows!?
>
> > Best to steer clear of trying to do anything with the site for a while if
> > you can help it.
>
> > --- 
> > --
> > TreKing  - Chicago
> > transit tracking app for Android-powered devices
>
> >  --
> > 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+unsubscr...@googlegroups.com > cr...@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 post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Apps missing in publisher console

2010-11-24 Thread Robert Green
I'm currently missing 4 of my apps!  Is anyone else having this
problem?

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: how many devices have the nexus one / HTC desire multi touch bug and would you release a game utilizing multitouch anyway?

2010-11-06 Thread Robert Green
Some facts:

All HTC phones up until the Incredible and EVO had the old synaptics
touch screen which did not support discrete touch points.  The new
high end phones (including the incredible and EVO) have much better
screens.

Motorola Droid, Droid 2 and Droid X all support discrete touch points.
Samsung Galaxy S phones (Vibrant, fascinate, etc) all support discrete
touch points.

Android 2.2 supplies a feature flag for discrete touch points so you
will be able to tell programmatically if you can use a discrete-touch
control scheme.

A smart game programmer would develop 3 control systems:  Single
Touch, Discrete MultiTouch and Non-Discrete Multitouch.  Ensure the
game is playable with all 3 systems, then use given the following
logic:

If (AndroidVersion < 2.0), use Single Touch
If (AndroidVersion >= 2.2 && SupportsFeature(DiscreteMultiTouch)), use
Discrete MultiTouch
Else use non-discrete multitouch

Educating the users as to what their phone does and does not support
is not an easy task.  I've been through the ringer on this issue and
I'm in the camp now where the more simple control system you can
devise for your game, the better.  The more complex your controls, the
taller the hill you will be climbing up trying to make it work nicely
for everyone and manage people's expectations about their device.

On Nov 6, 7:22 am, Yahel  wrote:
> Hi,
>
> Sorry but it's not only the nexus or the desire, it's all the htcs and
> some other.
>
> The answer to your question is in the market : Almost no games are
> multitouch because it is so broken.
>
> Mine(Armaboing) which is as simple as it can gets is using a massive
> amount of logic and took me a massivea amount of time to be almost
> decent in two players mode.
>
> If "massive multitouch gestures" is needed. Don't waste your time. Or
> be prepared to have only a very small share of the market and dreadful
> comments.
>
> I just realised : you said gesture. This might be different, my game
> uses only taps which are reported wrong almost everytime.
>
> In any case, you should prototype your gesture with a very simple app
> before and tests them on a nexus, a desire or a hero to see what
> happens for you.
>
> Yahel
>
> On Nov 6, 10:43 am, noriato  wrote:
>
>
>
>
>
>
>
> > Hi,
> > so there's the multitouch issue with the Nexus One and HTC Desire. Is
> > there some documentation on what other devices have this hardware
> > error and what the total market share is?
>
> > If you had a game idea that needs massive multitouch gestures, would
> > you go for it on Android or would it currently be a waste of time with
> > only a few devices supporting it?
>
> > Peter

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: OpenGL more textures for one rect

2010-11-02 Thread Robert Green
This is what glBindTexture() is for :)

On Nov 1, 3:15 pm, AFgan  wrote:
> In Android OpenGL ES, I want to be able to switch textures for a given
> Rectangle. I have one rect and I put two textures, depending on
> different conditions. I just want to switch between textures.
>
> I followed this code to create the 
> textures:http://blog.poweredbytoast.com/loading-opengl-textures-in-androidbut
> it seems that this is only for one texture.
>
> If I use only one texture, it renders fine, but then I don't know how
> to tell the rect to use another texture (same rect, different
> texture). Do I do something like "setTexture" with the ID that is
> generated in loadTextures()? Do I have to have an array with texture
> names (numbers) that I then change .. I just don't get it..
>
> Help is really appreciated.

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Problem with OpenGL ES application,please help

2010-10-25 Thread Robert Green
Or - make an atlas and only do 1 texture bind per cube.

Raging Thunder 2 probably only switches under a dozen times per draw
because of atlasing, group-by-texture optimizations, etc.

There are profiling tools you can get to check for performance
bottlenecks, btw.  Search for the Adreno profiler if you're running a
Qualcomm chip or Imagination Tech has stuff for the PowerVR chips.

On Oct 25, 1:21 pm, Nightwolf  wrote:
> Try reducing texture resolution.
> 128x128 texture for each of 6 sides of the cube. That means you do 6
> texture switches to draw one cube. 10 cubes - 60 texture switches per
> one scene.
> Use one texture for all your cubes and see what you get.
>
> On 25 окт, 16:40, gambiting  wrote:
>
>
>
>
>
>
>
> > Hi there,
>
> > I am currently trying to develop a game for android in OpenGL
> > ESand I am testing it on my Nexus One. But I have run into some
> > performance problems,and I would like to ask somebody about it,could
> > you help?
>
> > I currently have a very basic scene - background made of 25
> > tiles(256x256 texture each), and then a number of textured
> > cubes(128x128 texture for each side of a cube ). However,when I try to
> > display approx. more than 10 cubes, the performance becomes so
> > sluggish that I can't even rotate the scene smoothly. I can't imagine
> > how can I add more objects(player,enemies, all that kind of stuff)
> > when it runs so slowly with 35 objects in total. I mean - games like
> > Raging Thunder 2 probably display hundreds of objects at once(plus
> > they do lots of computations behind the scenes) and they run super-
> > smooth on my nexus one. What am I doing wrong? Could somebody help me
> > please

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Kube example with simple 3D object select

2010-10-22 Thread Robert Green
Luke,

Read these.

http://groups.google.com/group/android-developers/browse_thread/thread/6243785d31f904d7/155df9bc386bb0ad?lnk=gst&q=3d+selection#155df9bc386bb0ad
http://groups.google.com/group/android-developers/browse_thread/thread/3b9ab1117971fe11/65e1376de2b698e3?lnk=gst&q=3d+selection#65e1376de2b698e3

On Oct 22, 10:52 am, TreKing  wrote:
> On Tue, Oct 19, 2010 at 3:20 AM, Lukasz.Iwanski 
> wrote:
>
> > I have done research.. but I have huge problem with that.
>
> Huge problem with what?http://www.catb.org/esr/faqs/smart-questions.html
>
> --- 
> --
> TreKing  - Chicago
> transit tracking app for Android-powered devices

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Best phone for OpenGL game dev

2010-10-18 Thread Robert Green
FYI:

Extensions are only listed if the GL implementation is below the
version that has the same filter built-in.

For example, the original droid DOES support VBOs, but it's not listed
as an extension.  It shouldn't be, because you can see that the GLES
version given when initializing a 1.1 context is 1.1, meaning it has
all 1.1 features (of which VBOs are part of).  It will also initialize
a 2.0 context, meaning it will support all 2.0 standard features (so
don't expect an extension for FRAME_BUFFER_OBJECT etc, as that's part
of 2.0).

The first gen phones are 1.0, which does not include VBO support,
which is why you'll see a VBO extension on them (As well as many
others that you won't see on a 1.1 chip).

Extensions extend base functionality, which is why you don't see them
when the base functionality already contains it.  Please review the
official docs at http://www.khronos.org/registry/gles/ for more info
on this.

On Oct 18, 1:50 pm, EboMike  wrote:
> Well great, there are two threads now. Here's the other 
> one:http://stackoverflow.com/questions/2093594/opengl-extensions-availabl...
>
> On Oct 18, 11:48 am, EboMike  wrote:
>
>
>
>
>
>
>
> > The OS market share list is 
> > here:http://developer.android.com/resources/dashboard/platform-versions.html
>
> > My recommendation: Require Android 2.0 and Open GL ES 2.0, this will
> > allow you to use vertex/fragment shaders. Check for extensions like
> > vertex buffer objects and use them, but don't require them (the
> > original Droid doesn't have VBOs, but it still popular). That should
> > allow your app to run on most modern phones and have good performance.
> > Btw, there was a thread on Stack Overflow where people posted
> > available extensions on several 
> > phones:http://stackoverflow.com/questions/3881197/opengl-es-2-0-extensions-o...
>
> > -Mike
>
> > On Oct 18, 11:36 am, Tudor Tihan  wrote:
>
> > > Thank, 2.2 sounds good.
>
> > > I dont want to build a game that runs on all hardware, just the top
> > > range hardware,
> > > since fixed function looks like crap in nowadays shader world.
>
> > > Where would I find an accurate OS/device market share list?
>
> > > On Oct 16, 1:33 pm, Nightwolf  wrote:
>
> > > > Results are pretty good. However iPhone 4 has higher resolution (960
> > > > by 640) so in some cases it'll be harder for it to compete.
> > > > BTW Samsung Galaxy S gets Android 2.2 in Europe.
> > > > Anyway there are only 33% of Android 2.2 phones. And only few of them
> > > > are Samsung. If your game will run smooth only on one device you won't
> > > > get large install base.
>
> > > > On 14 ÏËÔ, 18:22, Tudor Tihan  wrote:
>
> > > > > Thank you all for your answers.
>
> > > > > @Nightwolf: That link was much appreciated. I also found this
> > > > > benchmark comparison, how do the results
> > > > > look to 
> > > > > you:http://www.glbenchmark.com/compare.jsp?benchmark=glpro11&showhide=tru...)
>
> > > > > @Andy:
>
> > > > > On Oct 14, 12:32šam, Adam Hammer  wrote:
>
> > > > > > I do mine on a N1.
>
> > > > > > 2.2 is a target if you want to support ES2.0. You can do so in 2.1 
> > > > > > but
> > > > > > it'll be a headache using the NDK for such. [...]
>
> > > > > Can you give me a bit more details on this? The only high performance
> > > > >phone
> > > > > I can get in my country (Romania) is the Samsung Galaxy S, but it is
> > > > > 2.1.
> > > > > I am interested in making use of shaders in a character detailed 3D
> > > > > video game
> > > > > with lots of particle effects. What sort of pain would I get myself
> > > > > into if I bought thatphone?

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Alternative to GLWallpaperService, OpenGL Live Wallpaper

2010-10-15 Thread Robert Green
The code I posted is mostly just a refactored GLSurfaceView from 2.1
Master.  It shouldn't perform differently unless something deeper down
is limiting.

On Oct 15, 10:15 am, "mr.winky"  wrote:
> Yes, I have verified with an opengl app under GLSurfaceView that I can
> get 60 fps. I havent been able to successfully adapt, beyond what
> Robert Green has posted, the GLSurfaceView to work for live wallpaper
> without the 30fps barrier.
>
> Is there someone out there that has solved this?
>
> On Oct 15, 6:54 am, Lance Nanek  wrote:
>
>
>
>
>
>
>
> > Did you lookup the usual refresh rate, which is indeed 60FPS, or did
> > you check the specific number for your phone? I know from my own
> > testing that the HTC Evo 4G cannot go above 30FPS in OpenGL, for
> > example. Chris Pruett mentioned one of the XPeria devices doing
> > similar, running at 30FPS, even when he draws a scene with nothing in
> > it (http://code.google.com/events/io/2010/sessions/writing-real-time-game...
> > ). I'm just pointing out that you may actually have one of these rarer
> > crippled phone models rather than a software issue.
>
> > On Oct 13, 1:56 am, "mr.winky"  wrote:
>
> > > I've been using theGLWallpaperServiceas posted by Robert Green
> > > (http://www.rbgrn.net/content/354-glsurfaceview-adapted-3d-live-
> > > wallpapers), which has worked so far for the live wallpapers but I'm
> > > hitting a wall when it comes to performance. The GL code is executing
> > > at the expected speed when swapping (about 14ms after the swap
> > > occurs), but there seems to be an extreme overhead with the wallpaper
> > > code of 33ms.
>
> > > For example, if I was to implement a basic live wallpaper that only
> > > called gl.glClearColor and nothing else, the maximum framerate I can
> > > achieve is 30fps (33ms), which is far lower than it should be. Now the
> > > phone refresh rate is 16ms, from what I have read, so I could
> > > understand hitting a wall at 60 fps.
>
> > > The question is if there is an alternative way out there? I tried
> > > naively using the GLSurfaceView with no luck and am looking for
> > > suggestions from those who may have encountered this issue or know of
> > > a solution. I have been googling but all posts send me back to the
> > > above site from Robert Green as the "only" way to do this, and I have
> > > had no luck finding a live wallpaper "sample" from the SDK that uses
> > > OpenGL while they state that you have access to OpenGL from here:
>
> > >http://developer.android.com/resources/articles/live-wallpapers.html
>
> > > I tried searching for the code for the bundled live wallpapers with no
> > > luck, if anyone could throw me a link to one of the wallpapers that
> > > uses OpenGL that would more than enough for me to figure it out (if a
> > > different method is used ;)).- Hide quoted text -
>
> > - Show quoted text -

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Alternative to GLWallpaperService, OpenGL Live Wallpaper

2010-10-13 Thread Robert Green
It was originally a submission for android master is why it is in that
namespace :)

Yes, if you use it (and be aware that it does NOT reset the gl context
on orientation changes so do not reload vram content like normal or at
least make sure to delete first) you will definitely want to put it in
your own package/namespace.

FYI - it doesn't delete the context because for some unknown reason
many phones like to hard freeze right in eglMakeDisplayCurrent with
the SharedBuffer timed out problem.  Leaving the context in tact
worked around it for some phones but there are other issues on other
phones as well.

On Oct 13, 1:43 am, Dianne Hackborn  wrote:
> Note that code is very broken -- it is putting a class in the android
> namespace, which it is not allowed to do.  PLEASE change this to a valid
> namespace before using it.  You are likely to break shortly if you don't.
>  Thanks.
>
>
>
>
>
>
>
>
>
> On Tue, Oct 12, 2010 at 10:56 PM, mr.winky  wrote:
> > I've been using the GLWallpaperService as posted by Robert Green
> > (http://www.rbgrn.net/content/354-glsurfaceview-adapted-3d-live-
> > wallpapers), which has worked so far for the live wallpapers but I'm
> > hitting a wall when it comes to performance. The GL code is executing
> > at the expected speed when swapping (about 14ms after the swap
> > occurs), but there seems to be an extreme overhead with the wallpaper
> > code of 33ms.
>
> > For example, if I was to implement a basic live wallpaper that only
> > called gl.glClearColor and nothing else, the maximum framerate I can
> > achieve is 30fps (33ms), which is far lower than it should be. Now the
> > phone refresh rate is 16ms, from what I have read, so I could
> > understand hitting a wall at 60 fps.
>
> > The question is if there is an alternative way out there? I tried
> > naively using the GLSurfaceView with no luck and am looking for
> > suggestions from those who may have encountered this issue or know of
> > a solution. I have been googling but all posts send me back to the
> > above site from Robert Green as the "only" way to do this, and I have
> > had no luck finding a live wallpaper "sample" from the SDK that uses
> > OpenGL while they state that you have access to OpenGL from here:
>
> >http://developer.android.com/resources/articles/live-wallpapers.html
>
> > I tried searching for the code for the bundled live wallpapers with no
> > luck, if anyone could throw me a link to one of the wallpapers that
> > uses OpenGL that would more than enough for me to figure it out (if a
> > different method is used ;)).
>
> > --
> > 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+unsubscr...@googlegroups.com > cr...@googlegroups.com>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: HelloWorld.... now what?

2010-10-10 Thread Robert Green
Skip straight to the custom 3D FPS engine :)

On Oct 11, 12:48 am, Rocky  wrote:
> Hey,
> go through the java code, xml code, and try to understand the flow, and
> replace hello world to ur customize text,
>
> then go through the developer.android.com for there u may find lots of
> example, try to run them.
>
> On Fri, Oct 8, 2010 at 3:13 AM, Joshua Germon 
> wrote:
>
> > I've just started here. I downloaded the SDK did the HelloWorld
> > tutorial and I don't no what to do next. This is the first Java
> > programing I've ever done. I want to start making my own apps but
> > how Please clear this up for me!
>
> > Cheers Josh
>
> > --
> > 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+unsubscr...@googlegroups.com > cr...@googlegroups.com>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Thanks & Regards
>
> Rakesh Kumar Jha
> Software Developer
> Symphony Services Corp (India) Pvt Ltd
> Bangalore
> (O) +918030274295
> (R) +919886336619

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: will the android emulator support opengles 2.0 in the future?

2010-10-04 Thread Robert Green
FWIW - The iPhone simulator does not emulate the actual phone.
Instead it routes calls to native OSX functions, simulating the
environment.  The Android emulator does in fact emulator an ARM CPU
and runs Android OS on it, which is an important distinction between
the two.  When using GL in the iPhone simulator, you're actually
running all of your GL on the PowerVR GLES emulation library, which
uses hardware.  It's great for developing but you still really need a
device to test since a PC GPU is going to be many times faster than a
mobile GPU.

So why can't the Android emulator do the same thing?  Because the PVR
lib is for x86/OSX and the Android emulator is running on ARM.



On Oct 4, 4:13 pm, Satya Komatineni 
wrote:
> From the posting so far I have seen, the current emulator as of API
> level 8 and Platform 2.2 does not support OpenGL ES 2.0. (Only in the
> emulator that the support is not there)
>
> (The support is there at API level 8 for the ES 2.0)
>
> wondering if any jone has figured out the following
>
> 1. Will the emulator support ES 2.0 in the future (considering there
> is compilers, shaders etc needed to support es 2.0)
> 2. What is a likely timeframe this may be available? (months or
> sometime future?)
>
> I suppose considering that iPhone SDK has the emulator suppor for es
> 2.0, it can be anticipated on the Android emulator as well.
>
> Thanks for the help
> Satya Komatinenihttp://www.satyakomatineni.comhttp://www.androidbook.com

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Mapping 6 faces of cube with 6 different images

2010-10-04 Thread Robert Green
Girish,

There are 2 tools you will need:

1)  Canvas APIs
2)  Your programming intuition

It's not hard.  Just load the 6 bitmaps, create your atlas one and
draw the 6 bitmaps to it, then store the percentages (learn about UV
coordinates somewhere) and use those percentages as your UVs.  Get the
redbook if you need more help - it's in there.

:)

On Oct 4, 2:23 am, Girish H T  wrote:
> Hi  Lance,
>
> Thanks for your answer.
>
> If i want to change the images dynamically how can that be possible ? Is it
> possible to generate the atlas @ runtime programatically ?
>
> Can you point me the the tools used for generating texture atlas ?
>
> Regards
> Girish

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: OpenGL lockups in 2.2

2010-10-02 Thread Robert Green
I actually am adding a "safe mode" setting to the game that people can
use if it's freezing on their device.  I can't have it on all the time
or the game really is unplayably slow on the first gen phones and it
never seems to lock up on those - just snapdragons.

What are you guys talking about with the swap interval?  Is that a
framebuffer thing and if so, where do you handle it?

Thanks

On Oct 2, 12:25 pm, Jeremy Statz  wrote:
> I'm not mixing Native in with anything either, straight Java is enough
> trouble as is.  :P
>
> I noticed a definitely framerate hit with glFinish as well, but I'd
> rather suffer through that than have it forcibly lock up and reboot
> people's phones.  The worst thing is everybody but HTC seems just fine
> either way.  I really don't want to end up with a setting that says
> "Check this if you have an HTC handset".
>
> After updating a few things I'm less sold on glFinish actually fixing
> the problem.  In particular I'm starting to get e-mails from people
> who just bought a G2, and those seem to be a whole new raft of random
> stuff happening.  The most recent EVO update introduced flickering on
> the bottom half of the screen, which I thought glFinish fixed, but it
> doesn't sound like it was a 100% fix.  It might just come down to the
> framerate being slower in that case.
>
> That said, maybe it means SwapInterval is a sensible thing to try, so
> I'll give it a shot.
>
> On Oct 2, 12:04 pm, Leigh McRae 
> wrote:
>
>
>
>
>
>
>
> >   Maybe set swap interval.  I have to say I feel your pain as Android is
> > starting to feel like PC when it comes to graphics drivers.
>
> > On 10/1/2010 9:03 PM, Robert Green wrote:
>
> > > Update - I just tested with eglWaitGL right before swapBuffers and I
> > > got the same nasty performance hit as glFinish.
>
> > > Any other ideas?
>
> > > On Oct 1, 7:43 pm, Robert Green  wrote:
> > >> I'm not mixing native with my context, but I get lots of reports of
> > >> freezing and have seen it on my Nexus One running both 2.1 and 2.2.
> > >> I'm just trying to find a solution to it.
>
> > >> On Oct 1, 7:04 pm, Leigh McRae  wrote:
>
> > >>>    I would never call glFinish unless I was reading a buffer back.  I
> > >>> would also never call glFlush.  Swapping the buffers will do this.  When
> > >>> I was writing drivers it was common for glFlush to be a NOP.
> > >>> With that said, if you're mixing native with your context use the
> > >>> eglWait functions.  I know eglWaitGL says it's the same as glFinish but
> > >>> I think the driver has a more clearer picture as to what is going on.
> > >>> On 10/1/2010 7:43 PM, Robert Green wrote:
> > >>>> After more testing it's apparent that glFinish is causing nearly
> > >>>> double the frame time and it's not my code causing the issue.
> > >>>> Do you think adding glFlush() will do anything useful?  I did that on
> > >>>> my first 3D game and no one's ever complained about it freezing.
> > >>>> On Oct 1, 6:12 pm, Robert Green    wrote:
> > >>>>> Bad news... My testing shows a very significant performance hit from
> > >>>>> doing this.
> > >>>>> Nexus One went from 40fps without ending on glFinish down to 20-27.
> > >>>>> G1 went from 30fps down to about 5-10.
> > >>>>> This is not good.  I can't just put that in and call it fixed or it'll
> > >>>>> make the game unplayable on low end phones.  I'll do some more testing
> > >>>>> and see if it's my threading causing problems but I have a bad feeling
> > >>>>> that it's not.
> > >>>>> On Sep 30, 3:30 pm, timedilation    wrote:
> > >>>>>> Jeremy, Glad to note that is has so far worked out for you.
> > >>>>>> Leigh, to your point, I also tested this with an explicit call to
> > >>>>>> eglWaitGL() function in my own version of GLSurfaceView (basically
> > >>>>>> this call was added just before the eglSwapBuffer() call). This also
> > >>>>>> fixed thefreezingin my case. I just resorted to using glFinish()
> > >>>>>> because that way I didn't have to use my own version of 
> > >>>>>> GLSurfaceView.
> > >>>>>> So if Google changed their GLSurfaceView in the next rele

[android-developers] Re: OpenGL lockups in 2.2

2010-10-01 Thread Robert Green
Update - I just tested with eglWaitGL right before swapBuffers and I
got the same nasty performance hit as glFinish.

Any other ideas?

On Oct 1, 7:43 pm, Robert Green  wrote:
> I'm not mixing native with my context, but I get lots of reports of
> freezing and have seen it on my Nexus One running both 2.1 and 2.2.
> I'm just trying to find a solution to it.
>
> On Oct 1, 7:04 pm, Leigh McRae  wrote:
>
>
>
>
>
>
>
> >   I would never call glFinish unless I was reading a buffer back.  I
> > would also never call glFlush.  Swapping the buffers will do this.  When
> > I was writing drivers it was common for glFlush to be a NOP.
>
> > With that said, if you're mixing native with your context use the
> > eglWait functions.  I know eglWaitGL says it's the same as glFinish but
> > I think the driver has a more clearer picture as to what is going on.
>
> > On 10/1/2010 7:43 PM, Robert Green wrote:
>
> > > After more testing it's apparent that glFinish is causing nearly
> > > double the frame time and it's not my code causing the issue.
>
> > > Do you think adding glFlush() will do anything useful?  I did that on
> > > my first 3D game and no one's ever complained about it freezing.
>
> > > On Oct 1, 6:12 pm, Robert Green  wrote:
> > >> Bad news... My testing shows a very significant performance hit from
> > >> doing this.
>
> > >> Nexus One went from 40fps without ending on glFinish down to 20-27.
> > >> G1 went from 30fps down to about 5-10.
>
> > >> This is not good.  I can't just put that in and call it fixed or it'll
> > >> make the game unplayable on low end phones.  I'll do some more testing
> > >> and see if it's my threading causing problems but I have a bad feeling
> > >> that it's not.
>
> > >> On Sep 30, 3:30 pm, timedilation  wrote:
>
> > >>> Jeremy, Glad to note that is has so far worked out for you.
> > >>> Leigh, to your point, I also tested this with an explicit call to
> > >>> eglWaitGL() function in my own version of GLSurfaceView (basically
> > >>> this call was added just before the eglSwapBuffer() call). This also
> > >>> fixed thefreezingin my case. I just resorted to using glFinish()
> > >>> because that way I didn't have to use my own version of GLSurfaceView.
> > >>> So if Google changed their GLSurfaceView in the next release, my code
> > >>> will not be affected much.
> > >>> When I mentioned this to a Google developer advocate and he said that
> > >>> this still needs to be fixed in the OS since it is an OS level bug.
> > >>> eglSwapBuffers() called glFlush() internally anyways but it ends up
> > >>> getting deadlocked once in a while on some of these devices we have
> > >>> seen. Explicitly calling eglWaitGL() or glFinish() in the renderloop
> > >>> *before* the eglSwapBuffers() appears to have fixed this issue in many
> > >>> (if not all) cases. I still have users reporting to me that their
> > >>> phonesfreezingeven with the latest update, albeit much less
> > >>> frequently.
> > >>> Let's hope for Google to fix this once and for all in their next
> > >>> release.
> > >>> On Sep 30, 2:26 pm, Leigh McRae
> > >>> wrote:
> > >>>>    You might want to look into the eglWait functions that are used to
> > >>>> synchronize with the native rendering system.
> > >>>> On 9/30/2010 2:07 PM, Jeremy Statz wrote:
> > >>>>> I've tested this extensively at this point (including a 20-hour run on
> > >>>>> an Incredible) and I think you're right, calling glFinish() seems like
> > >>>>> it largely fixes the problem.  Wow, I'd really thought that one was
> > >>>>> outmoded.
> > >>>>> Related to this, the most recent EVO update was causing the
> > >>>>> framebuffer to flicker with black squares sometimes on my wallpapers,
> > >>>>> and calling glFinish() fixed that too.  And it fixed a similar
> > >>>>> corruption I had reported a few days ago on the Nexus one.  It's the
> > >>>>> magic HTC fixer-upper!
> > >>>>> TimeDilation, you're my hero.
> > >>>>> On Sep 21, 3:26 pm, timedilation    wrote:
> > >>>>>> It was happening between 1 - 45 minut

[android-developers] Re: OpenGL lockups in 2.2

2010-10-01 Thread Robert Green
I'm not mixing native with my context, but I get lots of reports of
freezing and have seen it on my Nexus One running both 2.1 and 2.2.
I'm just trying to find a solution to it.

On Oct 1, 7:04 pm, Leigh McRae  wrote:
>   I would never call glFinish unless I was reading a buffer back.  I
> would also never call glFlush.  Swapping the buffers will do this.  When
> I was writing drivers it was common for glFlush to be a NOP.
>
> With that said, if you're mixing native with your context use the
> eglWait functions.  I know eglWaitGL says it's the same as glFinish but
> I think the driver has a more clearer picture as to what is going on.
>
> On 10/1/2010 7:43 PM, Robert Green wrote:
>
>
>
>
>
>
>
> > After more testing it's apparent that glFinish is causing nearly
> > double the frame time and it's not my code causing the issue.
>
> > Do you think adding glFlush() will do anything useful?  I did that on
> > my first 3D game and no one's ever complained about it freezing.
>
> > On Oct 1, 6:12 pm, Robert Green  wrote:
> >> Bad news... My testing shows a very significant performance hit from
> >> doing this.
>
> >> Nexus One went from 40fps without ending on glFinish down to 20-27.
> >> G1 went from 30fps down to about 5-10.
>
> >> This is not good.  I can't just put that in and call it fixed or it'll
> >> make the game unplayable on low end phones.  I'll do some more testing
> >> and see if it's my threading causing problems but I have a bad feeling
> >> that it's not.
>
> >> On Sep 30, 3:30 pm, timedilation  wrote:
>
> >>> Jeremy, Glad to note that is has so far worked out for you.
> >>> Leigh, to your point, I also tested this with an explicit call to
> >>> eglWaitGL() function in my own version of GLSurfaceView (basically
> >>> this call was added just before the eglSwapBuffer() call). This also
> >>> fixed thefreezingin my case. I just resorted to using glFinish()
> >>> because that way I didn't have to use my own version of GLSurfaceView.
> >>> So if Google changed their GLSurfaceView in the next release, my code
> >>> will not be affected much.
> >>> When I mentioned this to a Google developer advocate and he said that
> >>> this still needs to be fixed in the OS since it is an OS level bug.
> >>> eglSwapBuffers() called glFlush() internally anyways but it ends up
> >>> getting deadlocked once in a while on some of these devices we have
> >>> seen. Explicitly calling eglWaitGL() or glFinish() in the renderloop
> >>> *before* the eglSwapBuffers() appears to have fixed this issue in many
> >>> (if not all) cases. I still have users reporting to me that their
> >>> phonesfreezingeven with the latest update, albeit much less
> >>> frequently.
> >>> Let's hope for Google to fix this once and for all in their next
> >>> release.
> >>> On Sep 30, 2:26 pm, Leigh McRae
> >>> wrote:
> >>>>    You might want to look into the eglWait functions that are used to
> >>>> synchronize with the native rendering system.
> >>>> On 9/30/2010 2:07 PM, Jeremy Statz wrote:
> >>>>> I've tested this extensively at this point (including a 20-hour run on
> >>>>> an Incredible) and I think you're right, calling glFinish() seems like
> >>>>> it largely fixes the problem.  Wow, I'd really thought that one was
> >>>>> outmoded.
> >>>>> Related to this, the most recent EVO update was causing the
> >>>>> framebuffer to flicker with black squares sometimes on my wallpapers,
> >>>>> and calling glFinish() fixed that too.  And it fixed a similar
> >>>>> corruption I had reported a few days ago on the Nexus one.  It's the
> >>>>> magic HTC fixer-upper!
> >>>>> TimeDilation, you're my hero.
> >>>>> On Sep 21, 3:26 pm, timedilation    wrote:
> >>>>>> It was happening between 1 - 45 minutes into the app. Every single
> >>>>>> time.
> >>>>>> Maybe this is not a permanent fix and maybe it has just reduced the
> >>>>>> frequency of freezings. But as I mentioned before, so far I have not
> >>>>>> seen a single freeze since I made that change 2 days ago.
> >>>>>> On Sep 21, 4:05 pm, Robert Green    wrote:
> >>>>>>> And it was happening reliably befo

[android-developers] Re: OpenGL lockups in 2.2

2010-10-01 Thread Robert Green
After more testing it's apparent that glFinish is causing nearly
double the frame time and it's not my code causing the issue.

Do you think adding glFlush() will do anything useful?  I did that on
my first 3D game and no one's ever complained about it freezing.

On Oct 1, 6:12 pm, Robert Green  wrote:
> Bad news... My testing shows a very significant performance hit from
> doing this.
>
> Nexus One went from 40fps without ending on glFinish down to 20-27.
> G1 went from 30fps down to about 5-10.
>
> This is not good.  I can't just put that in and call it fixed or it'll
> make the game unplayable on low end phones.  I'll do some more testing
> and see if it's my threading causing problems but I have a bad feeling
> that it's not.
>
> On Sep 30, 3:30 pm, timedilation  wrote:
>
>
>
>
>
>
>
> > Jeremy, Glad to note that is has so far worked out for you.
>
> > Leigh, to your point, I also tested this with an explicit call to
> > eglWaitGL() function in my own version of GLSurfaceView (basically
> > this call was added just before the eglSwapBuffer() call). This also
> > fixed thefreezingin my case. I just resorted to using glFinish()
> > because that way I didn't have to use my own version of GLSurfaceView.
> > So if Google changed their GLSurfaceView in the next release, my code
> > will not be affected much.
>
> > When I mentioned this to a Google developer advocate and he said that
> > this still needs to be fixed in the OS since it is an OS level bug.
> > eglSwapBuffers() called glFlush() internally anyways but it ends up
> > getting deadlocked once in a while on some of these devices we have
> > seen. Explicitly calling eglWaitGL() or glFinish() in the renderloop
> > *before* the eglSwapBuffers() appears to have fixed this issue in many
> > (if not all) cases. I still have users reporting to me that their
> > phonesfreezingeven with the latest update, albeit much less
> > frequently.
>
> > Let's hope for Google to fix this once and for all in their next
> > release.
>
> > On Sep 30, 2:26 pm, Leigh McRae 
> > wrote:
>
> > >   You might want to look into the eglWait functions that are used to
> > > synchronize with the native rendering system.
>
> > > On 9/30/2010 2:07 PM, Jeremy Statz wrote:
>
> > > > I've tested this extensively at this point (including a 20-hour run on
> > > > an Incredible) and I think you're right, calling glFinish() seems like
> > > > it largely fixes the problem.  Wow, I'd really thought that one was
> > > > outmoded.
>
> > > > Related to this, the most recent EVO update was causing the
> > > > framebuffer to flicker with black squares sometimes on my wallpapers,
> > > > and calling glFinish() fixed that too.  And it fixed a similar
> > > > corruption I had reported a few days ago on the Nexus one.  It's the
> > > > magic HTC fixer-upper!
>
> > > > TimeDilation, you're my hero.
>
> > > > On Sep 21, 3:26 pm, timedilation  wrote:
> > > >> It was happening between 1 - 45 minutes into the app. Every single
> > > >> time.
> > > >> Maybe this is not a permanent fix and maybe it has just reduced the
> > > >> frequency of freezings. But as I mentioned before, so far I have not
> > > >> seen a single freeze since I made that change 2 days ago.
>
> > > >> On Sep 21, 4:05 pm, Robert Green  wrote:
>
> > > >>> And it was happening reliably before?
> > > >>> On Sep 21, 12:48 pm, timedilation  wrote:
> > > >>>> I haven't seen any freeze since making that change (I am only testing
> > > >>>> this on the HTC Desire running 2.2)
> > > >>>> On Sep 21, 1:32 pm, Robert Green  wrote:
> > > >>>>> So after finishing with glFinish(), you haven't seen a freeze at all
> > > >>>>> or you just saw one now?  I'm not sure what to make of the "until 
> > > >>>>> now"
> > > >>>>> part :)
> > > >>>>> If you really think that's making a difference, I'll try it out and
> > > >>>>> see if it makes a difference for my games as well, though I have to
> > > >>>>> play for about an hour to see it happen.
> > > >>>>> On Sep 21, 12:10 pm, timedilation  wrote:
> > > >>>>>> Not sure if the following will fix thefreezingin all cases

[android-developers] Re: OpenGL lockups in 2.2

2010-10-01 Thread Robert Green
Bad news... My testing shows a very significant performance hit from
doing this.

Nexus One went from 40fps without ending on glFinish down to 20-27.
G1 went from 30fps down to about 5-10.

This is not good.  I can't just put that in and call it fixed or it'll
make the game unplayable on low end phones.  I'll do some more testing
and see if it's my threading causing problems but I have a bad feeling
that it's not.

On Sep 30, 3:30 pm, timedilation  wrote:
> Jeremy, Glad to note that is has so far worked out for you.
>
> Leigh, to your point, I also tested this with an explicit call to
> eglWaitGL() function in my own version of GLSurfaceView (basically
> this call was added just before the eglSwapBuffer() call). This also
> fixed thefreezingin my case. I just resorted to using glFinish()
> because that way I didn't have to use my own version of GLSurfaceView.
> So if Google changed their GLSurfaceView in the next release, my code
> will not be affected much.
>
> When I mentioned this to a Google developer advocate and he said that
> this still needs to be fixed in the OS since it is an OS level bug.
> eglSwapBuffers() called glFlush() internally anyways but it ends up
> getting deadlocked once in a while on some of these devices we have
> seen. Explicitly calling eglWaitGL() or glFinish() in the renderloop
> *before* the eglSwapBuffers() appears to have fixed this issue in many
> (if not all) cases. I still have users reporting to me that their
> phonesfreezingeven with the latest update, albeit much less
> frequently.
>
> Let's hope for Google to fix this once and for all in their next
> release.
>
> On Sep 30, 2:26 pm, Leigh McRae 
> wrote:
>
>
>
>
>
>
>
> >   You might want to look into the eglWait functions that are used to
> > synchronize with the native rendering system.
>
> > On 9/30/2010 2:07 PM, Jeremy Statz wrote:
>
> > > I've tested this extensively at this point (including a 20-hour run on
> > > an Incredible) and I think you're right, calling glFinish() seems like
> > > it largely fixes the problem.  Wow, I'd really thought that one was
> > > outmoded.
>
> > > Related to this, the most recent EVO update was causing the
> > > framebuffer to flicker with black squares sometimes on my wallpapers,
> > > and calling glFinish() fixed that too.  And it fixed a similar
> > > corruption I had reported a few days ago on the Nexus one.  It's the
> > > magic HTC fixer-upper!
>
> > > TimeDilation, you're my hero.
>
> > > On Sep 21, 3:26 pm, timedilation  wrote:
> > >> It was happening between 1 - 45 minutes into the app. Every single
> > >> time.
> > >> Maybe this is not a permanent fix and maybe it has just reduced the
> > >> frequency of freezings. But as I mentioned before, so far I have not
> > >> seen a single freeze since I made that change 2 days ago.
>
> > >> On Sep 21, 4:05 pm, Robert Green  wrote:
>
> > >>> And it was happening reliably before?
> > >>> On Sep 21, 12:48 pm, timedilation  wrote:
> > >>>> I haven't seen any freeze since making that change (I am only testing
> > >>>> this on the HTC Desire running 2.2)
> > >>>> On Sep 21, 1:32 pm, Robert Green  wrote:
> > >>>>> So after finishing with glFinish(), you haven't seen a freeze at all
> > >>>>> or you just saw one now?  I'm not sure what to make of the "until now"
> > >>>>> part :)
> > >>>>> If you really think that's making a difference, I'll try it out and
> > >>>>> see if it makes a difference for my games as well, though I have to
> > >>>>> play for about an hour to see it happen.
> > >>>>> On Sep 21, 12:10 pm, timedilation  wrote:
> > >>>>>> Not sure if the following will fix thefreezingin all cases but it
> > >>>>>> appears to have fixed it in my app. I still have my fingers crossed
> > >>>>>> about it although my app hasn't frozen for a while now - even when I
> > >>>>>> let it run overnight on an HTC Desire 2.2.
> > >>>>>> I first took the source code of GLSurfaceView into my custom class 
> > >>>>>> and
> > >>>>>> added this line immediately before the eglSwapBuffer() call in the
> > >>>>>> EGLHelper class function:
> > >>>>>> mEgl.glWaitGL();
> > >>>>>> This is

[android-developers] Re: OpenGL lockups in 2.2

2010-09-21 Thread Robert Green
And it was happening reliably before?

On Sep 21, 12:48 pm, timedilation  wrote:
> I haven't seen any freeze since making that change (I am only testing
> this on the HTC Desire running 2.2)
>
> On Sep 21, 1:32 pm, Robert Green  wrote:
>
>
>
> > So after finishing with glFinish(), you haven't seen a freeze at all
> > or you just saw one now?  I'm not sure what to make of the "until now"
> > part :)
>
> > If you really think that's making a difference, I'll try it out and
> > see if it makes a difference for my games as well, though I have to
> > play for about an hour to see it happen.
>
> > On Sep 21, 12:10 pm, timedilation  wrote:
>
> > > Not sure if the following will fix the freezing in all cases but it
> > > appears to have fixed it in my app. I still have my fingers crossed
> > > about it although my app hasn't frozen for a while now - even when I
> > > let it run overnight on an HTC Desire 2.2.
>
> > > I first took the source code of GLSurfaceView into my custom class and
> > > added this line immediately before the eglSwapBuffer() call in the
> > > EGLHelper class function:
>
> > > mEgl.glWaitGL();
>
> > > This is a blocking call that waits for all existing GL commands to be
> > > processed before returning. With this line, the freezing seems to have
> > > stopped.
>
> > > I then realized that the glFinish() function does the same thing. So I
> > > went back to using the built-in GLSurfaceView and added the glFinish()
> > > call at the very end of my renderer.onDrawFrame() function. This had
> > > the same effect and I haven't seen a freeze until now. I suspect this
> > > call is just making the loop wait explicitly for all GL commands to be
> > > processed before rendering again. I took a look in the profiler and
> > > this call did not add any extra overhead (likely because the
> > > eglSwapBuffers() is also a blocking call and does the same thing -
> > > except that it freezes randomly).
>
> > > If the freezing starts again, I will update this post.
> > > Hope this works for you all out there too.
>
> > > On Sep 17, 7:46 am, String  wrote:
>
> > > > It's not all OpenGL implementations, that's for sure. I have 2 apps
> > > > with OpenGL live wallpapers; one has had the lockup problem, the other
> > > > hasn't. Architecturally, they're very similar - I based the later one
> > > > off the earlier. It was by pursuing the differences (like changing
> > > > textures mid-stream, as I discussed in an earlier post) that I've been
> > > > able to stop the lockups so far.
>
> > > > String
>
> > > > On Sep 17, 4:26 am, timedilation  wrote:
>
> > > > > I have played games like Winds of Steel for hours on my HTC desire.
> > > > > Surely they must be using opengl as well (I think). And the FPS is
> > > > > also pretty good. How's it that those games do not freeze at all? I
> > > > > need to dissect those and see what calls they are making.
>
> > > > > On Sep 15, 12:17 pm, Jeremy Statz  wrote:
>
> > > > > > I just let the same wallpaper run uninterrupted on a Motorola Droid
> > > > > > for something like 16 hours and it's still fine.  I would've 
> > > > > > expected
> > > > > > my Incredible to have hit the problem by then.  I also haven't heard
> > > > > > any reports of this from folks with a  Galaxy S variant.
>
> > > > > > On Sep 14, 7:38 pm, timedilation  wrote:
>
> > > > > > > This appears to be an HTC specific bug. My app never freezes on 
> > > > > > > the
> > > > > > > Motorla Droid. EVER. It is very stable on the Droid and I have 
> > > > > > > tested
> > > > > > > it for about 4months without a single freeze. Interestingly 
> > > > > > > though it
> > > > > > > never froze on my G1 either. The G1 I have is the ADP1 phone I 
> > > > > > > bought
> > > > > > > directly from Google.
>
> > > > > > > All other HTC phones that I have exhibit the freezing - Evo, 
> > > > > > > Desire
> > > > > > > and Nexus One (which is also from HTC I believe).
>
> > > > > > > Apart from that I tested it for a month on Samsung Moment. There 
> > > > > &g

[android-developers] Re: OpenGL lockups in 2.2

2010-09-21 Thread Robert Green
So after finishing with glFinish(), you haven't seen a freeze at all
or you just saw one now?  I'm not sure what to make of the "until now"
part :)

If you really think that's making a difference, I'll try it out and
see if it makes a difference for my games as well, though I have to
play for about an hour to see it happen.

On Sep 21, 12:10 pm, timedilation  wrote:
> Not sure if the following will fix the freezing in all cases but it
> appears to have fixed it in my app. I still have my fingers crossed
> about it although my app hasn't frozen for a while now - even when I
> let it run overnight on an HTC Desire 2.2.
>
> I first took the source code of GLSurfaceView into my custom class and
> added this line immediately before the eglSwapBuffer() call in the
> EGLHelper class function:
>
> mEgl.glWaitGL();
>
> This is a blocking call that waits for all existing GL commands to be
> processed before returning. With this line, the freezing seems to have
> stopped.
>
> I then realized that the glFinish() function does the same thing. So I
> went back to using the built-in GLSurfaceView and added the glFinish()
> call at the very end of my renderer.onDrawFrame() function. This had
> the same effect and I haven't seen a freeze until now. I suspect this
> call is just making the loop wait explicitly for all GL commands to be
> processed before rendering again. I took a look in the profiler and
> this call did not add any extra overhead (likely because the
> eglSwapBuffers() is also a blocking call and does the same thing -
> except that it freezes randomly).
>
> If the freezing starts again, I will update this post.
> Hope this works for you all out there too.
>
> On Sep 17, 7:46 am, String  wrote:
>
>
>
> > It's not all OpenGL implementations, that's for sure. I have 2 apps
> > with OpenGL live wallpapers; one has had the lockup problem, the other
> > hasn't. Architecturally, they're very similar - I based the later one
> > off the earlier. It was by pursuing the differences (like changing
> > textures mid-stream, as I discussed in an earlier post) that I've been
> > able to stop the lockups so far.
>
> > String
>
> > On Sep 17, 4:26 am, timedilation  wrote:
>
> > > I have played games like Winds of Steel for hours on my HTC desire.
> > > Surely they must be using opengl as well (I think). And the FPS is
> > > also pretty good. How's it that those games do not freeze at all? I
> > > need to dissect those and see what calls they are making.
>
> > > On Sep 15, 12:17 pm, Jeremy Statz  wrote:
>
> > > > I just let the same wallpaper run uninterrupted on a Motorola Droid
> > > > for something like 16 hours and it's still fine.  I would've expected
> > > > my Incredible to have hit the problem by then.  I also haven't heard
> > > > any reports of this from folks with a  Galaxy S variant.
>
> > > > On Sep 14, 7:38 pm, timedilation  wrote:
>
> > > > > This appears to be an HTC specific bug. My app never freezes on the
> > > > > Motorla Droid. EVER. It is very stable on the Droid and I have tested
> > > > > it for about 4months without a single freeze. Interestingly though it
> > > > > never froze on my G1 either. The G1 I have is the ADP1 phone I bought
> > > > > directly from Google.
>
> > > > > All other HTC phones that I have exhibit the freezing - Evo, Desire
> > > > > and Nexus One (which is also from HTC I believe).
>
> > > > > Apart from that I tested it for a month on Samsung Moment. There was
> > > > > NO freezing there either.
> > > > > I have been in touch with a Google developer advocate and I have
> > > > > submitted the bug report to his team. They are looking into this as
> > > > > well.
>
> > > > > On Sep 14, 8:23 pm, Jeremy Statz  wrote:
>
> > > > > > That's my experience as well.  All my log results say that there's 
> > > > > > no
> > > > > > loading or anything necessary -- the frame it dies on is bog 
> > > > > > standard,
> > > > > > with drawFrame going from beginning to end.  Any loading is long 
> > > > > > since
> > > > > > done.
>
> > > > > > I'm currently wondering if this is an HTC driver bug.  I'm going to
> > > > > > let this run on a Motorola Droid all night and see if it crashes.  
> > > > > > Not
> > > > > > sure I'm expecting it to, as my fiance has been using my wallpapers 
> > > > > > on
> > > > > > her Droid since forever and says she's never seen it lock and reboot
> > > > > > like we're describing.  Is there anyone at HTC to take something 
> > > > > > like
> > > > > > that to, if I gather some evidence?
>
> > > > > > On Sep 14, 3:32 pm, timedilation  wrote:
>
> > > > > > > That's interesting..
> > > > > > > Although I know for sure that all my gl* calls are happening only 
> > > > > > > in
> > > > > > > the GL thread. And this freezing happens even when I simply leave 
> > > > > > > the
> > > > > > > device (HTC Desire) running my app with zero user interaction
> > > > > > > whatsoever. All the app renders is a scenery with a single 
> > > > > > > animation.
> > > > > > > No textu

[android-developers] Re: Android devices supporting OpenGL ES 2.0 (at least through NDK) as of September 2010

2010-09-21 Thread Robert Green
You're going to find a couple of major chips used for Android phones
so just knowing that lets you know what it supports:

Integrated CPU/GPU
Qualcomm MSM7200 - OpenGL ES 1.1 (G1, Hero, MyTouch, Cliq, Blur, Eris)
Qualcomm Snapdragon - ES 2.0 (N1, EVO, Incredible, others)

Dedicated GPU
Any PowerVR SGX 5xx - ES 2.0 (Droid, Galaxy S, many others)


On Sep 21, 8:33 am, RS  wrote:
> Thanks, hope that would be the same on the Samsung tablet too.
> I'd be very happy to hear from anybody with any other device even if
> it doesn't support OpenGL ES 2.0, especially if you could post the
> supported extensions.
> Thanks again.
> RS
>
> On Sep 21, 1:05 pm, nagaraj attimani 
> wrote:
>
>
>
> > Samsung Galaxy supports OpenGL ES 2.0
>
> > On Tue, Sep 21, 2010 at 5:30 PM, RS  wrote:
> > > Is there some place where I can find a list of android devices with
> > > OpenGL ES 2.0 (at least through NDK for 2.x devices)?
>
> > > Or could some developer with any of these comment on how OpenGL ES 2.0
> > > worked on their device?
> > >  - Nexus One - running SDK 2.1 (Works through NDK)
> > >  - Nexus One - running SDK 2.2 (Works)
> > >  - Droid (Works)
> > >  - Droid 2 (Works)
> > >  - Samsung (various phone models) ?
> > >  - Samsung Tablet ?
> > >  - Any other ?
>
> > > To know the extensions available would also be very useful.
> > > Desire appears very close to Nexus One as expected.
>
> > > The list in stackoverflow is old but the closest I could find:
>
> > >http://stackoverflow.com/questions/2093594/opengl-extensions-availabl...
>
> > > Thanks in advance,
> > > RS
>
> > > --
> > > 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+unsubscr...@googlegroups.com > >  cr...@googlegroups.com>
> > > For more options, visit this group at
> > >http://groups.google.com/group/android-developers?hl=en
>
> > --
> > Warm Regards,
> > Nagaraj

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Why aren't the 2D graphics API & UI toolkit hardware accelerated?

2010-09-18 Thread Robert Green
Bah, 2D in OpenGL really isn't that hard and there's not that much
extra code.  If someone were to just write a simple spriterenderer
class that takes a set of bitmaps and lets you draw them wherever you
want by index then improve it to handle an atlas of images for faster
drawing and you've got 90% of most 2D game rendering code done right
there, all in under a couple hundred or so lines.

The lifecycle isn't that bad - all you ever have to do is reload vram-
stored stuff like textures and VBOs, which I just have a method called
vInit() that does that for any given renderer in the game, and when
the gl context has changed, my main renderer just calls vInit() on all
the subrenderers and all is back into the context and ready.  I think
that took me all of a few hours to get working correctly.

On Sep 18, 1:55 pm, Leigh McRae 
wrote:
>   On 9/18/2010 2:23 PM, Dianne Hackborn wrote:> On Fri, Sep 17, 2010 at 7:54 
> PM, Leigh McRae
> >  > > wrote:
>
> >      Making a few fast paths for drawing bitmaps (BitBlt) would be
> >     huge for game developers.  I know that 3 of my games I have made
> >     aren't OGL simply because I don't want the extra code
> >     maintenance/burden.  If a game is doing some of the things you
> >     mention, well then it's not likely concerned with frame-rate.
>
> > Use OpenGL ES.
>
> As I stated, using OpenGL ES requires extra code.  You to manage
> re-loading the assets such as textures and VBO.  With the Android
> Activity life cycle this is even more of an issue than other platforms.  
> This isn't trivial.  It also exposes you to driver bugs/oddities.
>
> > Seriously, you generally can't just accelerate one function and
> > nothing else.  What you will end up with is the worst of both worlds,
> > as you take the hit of switching between hardware and software
> > rendering all the time.
>
> You can actually.  I don't think it's being suggested that you use the
> OpenGL driver to implement a basic bitblt.  Its being suggested that the
> Android OS supports the ability for hardware to accelerate the bitblt.  
> Maybe it already does, I don't know.
>
> > If you just want to draw bitmaps to the screen, this can certainly be
> > accomplished with Open GL ES, and you don't need to rely on the
> > platform to provide you with essentially helper APIs to make it easier
> > to do that particular special case.  You can ask anyone here to write
> > such a thing for you.  Waiting for the platform to provide it is a
> > really bad option because you don't know when it will be available (we
> > don't really, either), and even once it does become available you
> > can't really take advantage of it until it is available on the
> > majority of the devices.
>
> > There are so many things people can do without relying on the platform
> > to give it to them in a nice little bundle.
>
> I don't think anyone is waiting.  I believe it was just a
> request/suggestion.
>
>
>
>
>
>
>
> > --
> > Dianne Hackborn
> > Android framework engineer
> > hack...@android.com 
>
> > Note: please don't send private questions to me, as I don't have time
> > to provide private support, and so won't reply to such e-mails.  All
> > such questions should be posted on public forums, where I and others
> > can see and answer them.
>
> > --
> > 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+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Leigh McRaewww.lonedwarfgames.com

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: trigonometry

2010-09-15 Thread Robert Green
Kostya - My mistake.  My example was for Math.atan.  atan2 just does
the divide for you.  Either will work.

On Sep 15, 11:50 am, Kostya Vasilyev  wrote:
>   Um, no.
>
> Math.atan2 takes two values, not one.
>
> Math.atan2(y2 - y1, x2 - x1)
>
> This gives correct result even for x2 and x1 being very close to each
> other. Depending on the sign of y2 - y1 that's either "up" or "down".
>
> -- Kostya
>
> 15.09.2010 20:45, Robert Green пишет:
>
>
>
>
>
> > Kostya hit it:
>
> > float angleDegrees = Math.toDegrees(Math.atan2((y1 - y2) / (x1 -
> > x2)));
>
> > On Sep 15, 11:32 am, Kostya Vasilyev  wrote:
> >>    Pedro,
>
> >> Java (and pretty much any language's) trig functions work with angles
> >> expressed in radians.
>
> >>http://en.wikipedia.org/wiki/Radian
>
> >> To convert to degrees, multiply by 180 / 3,1415926 (in Java, that's
> >> Math.PI). Or just call Math.toDegrees.
>
> >> Better yet - use Math.atan2 ( difference along Y, different along X).
> >> This one correctly handles the case of value3-value4 being zero (or very
> >> close thereof).
>
> >> -- Kostya
>
> >> 15.09.2010 20:22, Pedro Teixeira пишет:
>
> >>> Hi,
> >>> I'm having problems with JAva and trigonometry to calculate a
> >>> direction from a point to a certain point...
> >>> I want to translate this equation to Java-wise:
> >>> tg^-1 = |value1-value2| / |value3-value4|
> >>> And I'd like the result in degrees.. how can I do this? any ideia?
> >> --
> >> Kostya Vasilyev -- WiFi Manager + pretty widget 
> >> --http://kmansoft.wordpress.com
>
> --
> Kostya Vasilyev -- WiFi Manager + pretty widget 
> --http://kmansoft.wordpress.com

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: trigonometry

2010-09-15 Thread Robert Green
Kostya hit it:

float angleDegrees = Math.toDegrees(Math.atan2((y1 - y2) / (x1 -
x2)));

On Sep 15, 11:32 am, Kostya Vasilyev  wrote:
>   Pedro,
>
> Java (and pretty much any language's) trig functions work with angles
> expressed in radians.
>
> http://en.wikipedia.org/wiki/Radian
>
> To convert to degrees, multiply by 180 / 3,1415926 (in Java, that's
> Math.PI). Or just call Math.toDegrees.
>
> Better yet - use Math.atan2 ( difference along Y, different along X).
> This one correctly handles the case of value3-value4 being zero (or very
> close thereof).
>
> -- Kostya
>
> 15.09.2010 20:22, Pedro Teixeira пишет:
>
> > Hi,
>
> > I'm having problems with JAva and trigonometry to calculate a
> > direction from a point to a certain point...
>
> > I want to translate this equation to Java-wise:
>
> > tg^-1 = |value1-value2| / |value3-value4|
>
> > And I'd like the result in degrees.. how can I do this? any ideia?
>
> --
> Kostya Vasilyev -- WiFi Manager + pretty widget 
> --http://kmansoft.wordpress.com

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: OpenGL lockups in 2.2

2010-09-14 Thread Robert Green
, with a fluch() after every line being
> > > written.  This wrecks the framerate and results in a several hundred
> > > meg log after a few hours, but means I have a reliable log of all
> > > activity throughout the application.  Consistently, the crash occurs
> > > in-between frames, and requires no special stimulation -- the phone
> > > can just be sitting there running, then will suddenly die without
> > > warning.  I'm confident saying that.
>
> > > I've actually been using your GLWallpaperService code as a base,
> > > though I've made a couple minor changes.  It's been quite stable
> > > overall.  The big problem here, in my eyes, is that this appears to
> > > affect any OpenGL using application, and is tremendously discouraging,
> > > to the point that people pull things off the market and avoid using
> > > OpenGL.  This hurts the platform as a whole, especially when comparing
> > > its game library to the iPhone.
>
> > > On top of that, while this seemed exceedingly uncommon on 2.1, I feel
> > > like I've seen a whole lot more of it with 2.2 on my HTC Incredible.
> > > Considering the free versions of my wallpapers have something like
> > > three or four million downloads between them, that scares me a great
> > > deal.  That's a lot of potentially affected users.
>
> > > On Sep 13, 3:22 am, Robert Green  wrote:
>
> > > > Jeremy,
>
> > > > It happened to me quite a bit on both 2.1 and 2.2 on every device.
> > > > It's surely a defect of Android but so far no one has been able to
> > > > track it down.  It's a tough one, very difficult to reproduce
> > > > reliably.  It tends to happen more often in certain cases for reasons
> > > > unknown to me right now, such as on an EVO running 2.1 on the third
> > > > level of Deadly Chambers if you play it straight through.  Since that
> > > > takes 20 minutes, it's impossible to figure out by logging because
> > > > it's just way too much.  Breakpoints don't work because the game
> > > > doesn't run fast enough in debug mode and debugging doesn't work
> > > > anyways once the lockup has happened.
>
> > > > It's pretty much a worse case scenario - a very fatal, very
> > > > intermittent bug that breaks debugging and is nearly impossible to
> > > > isolate.
>
> > > > I hope some genius out there can figure this one out.  I couldn't even
> > > > get close.
>
> > > > On Sep 12, 10:34 pm, Jeremy Statz  wrote:
>
> > > > > There's been a couple threads about this in the last year or so, but
> > I
> > > > > wanted to draw attention to it again, as I've spent most of the last
> > > > > couple of days trying to confirm it wasn't anything I'm doing.
>
> > > > > The short story is, I'm pretty sure there's a very serious
> > lock-up-the-
> > > > > phone level bug that happens when using OpenGL applications.  When it
> > > > > occurs the phone will freeze for at least two minutes before
> > rebooting
> > > > > itself, sometimes requiring that the battery be pulled.  This didn't
> > > > > seem to happen often on 2.1, but I'm seeing it with a lot more
> > > > > regularity on 2.2 (particularly on HTC phones, though that may be a
> > > > > coincidence) and am really hoping to draw some attention from someone
> > > > > in a position to fix it.  Typically, you'll end up seeing hundreds of
> > > > > lines of this in the LogCat log:
>
> > > > > WARN/SharedBufferStack(2005): waitForCondition(LockCondition) timed
> > > > > out (identity=9, status=0). CPU may be pegged. trying again.
> > > > > WARN/SharedBufferStack(71): waitForCondition(LockCondition) timed out
> > > > > (identity=9, status=0). CPU may be pegged. trying again.
>
> > > > > There won't be any callstack or error of any kind preceding this.  In
> > > > > this case 2005 is my app (a live wallpaper), and 71 appears to be the
> > > > > UI/system process.  I'm assuming this is a race condition within
> > > > > SharedBufferStack.  I've seen cases where four or five process IDs
> > > > > were all printing the message, all OpenGL apps of some kind.
>
> > > > > Replicating the problem is very, very difficult and seems very
> > > &g

[android-developers] Re: OpenGL lockups in 2.2

2010-09-13 Thread Robert Green
I'm sorry - let me clarify something.  When I said, "quite a bit," I
mean that it happened to me on both versions at least once on every
device I tested on.  To quantify better, it happened maybe a total of
20 times in about 400 hours of play testing.  It happens more often to
others according to support emails I've received.

On Sep 13, 3:22 am, Robert Green  wrote:
> Jeremy,
>
> It happened to me quite a bit on both 2.1 and 2.2 on every device.
> It's surely a defect of Android but so far no one has been able to
> track it down.  It's a tough one, very difficult to reproduce
> reliably.  It tends to happen more often in certain cases for reasons
> unknown to me right now, such as on an EVO running 2.1 on the third
> level of Deadly Chambers if you play it straight through.  Since that
> takes 20 minutes, it's impossible to figure out by logging because
> it's just way too much.  Breakpoints don't work because the game
> doesn't run fast enough in debug mode and debugging doesn't work
> anyways once the lockup has happened.
>
> It's pretty much a worse case scenario - a very fatal, very
> intermittent bug that breaks debugging and is nearly impossible to
> isolate.
>
> I hope some genius out there can figure this one out.  I couldn't even
> get close.
>
> On Sep 12, 10:34 pm, Jeremy Statz  wrote:
>
>
>
> > There's been a couple threads about this in the last year or so, but I
> > wanted to draw attention to it again, as I've spent most of the last
> > couple of days trying to confirm it wasn't anything I'm doing.
>
> > The short story is, I'm pretty sure there's a very serious lock-up-the-
> > phone level bug that happens when using OpenGL applications.  When it
> > occurs the phone will freeze for at least two minutes before rebooting
> > itself, sometimes requiring that the battery be pulled.  This didn't
> > seem to happen often on 2.1, but I'm seeing it with a lot more
> > regularity on 2.2 (particularly on HTC phones, though that may be a
> > coincidence) and am really hoping to draw some attention from someone
> > in a position to fix it.  Typically, you'll end up seeing hundreds of
> > lines of this in the LogCat log:
>
> > WARN/SharedBufferStack(2005): waitForCondition(LockCondition) timed
> > out (identity=9, status=0). CPU may be pegged. trying again.
> > WARN/SharedBufferStack(71): waitForCondition(LockCondition) timed out
> > (identity=9, status=0). CPU may be pegged. trying again.
>
> > There won't be any callstack or error of any kind preceding this.  In
> > this case 2005 is my app (a live wallpaper), and 71 appears to be the
> > UI/system process.  I'm assuming this is a race condition within
> > SharedBufferStack.  I've seen cases where four or five process IDs
> > were all printing the message, all OpenGL apps of some kind.
>
> > Replicating the problem is very, very difficult and seems very
> > random... in the last case I had to leave the wallpaper running and
> > active on the home screen for about seven hours before it occurred.
> > Sometimes I've had it go days, other times it'll happen within a few
> > minutes.  My log output demonstrates no unusual activity at all before
> > the crash, loading/unloading/visibility/etc doesn't seem to be a
> > factor.  It's very rare.
>
> > I kind of feel like this got glossed over the last couple times people
> > have reported it here, but based on my reading it's a long-standing
> > problem with Android and OpenGL and is having a chilling effect on its
> > usage.  Is there anyone who can explain if there's anything I can do
> > to discourage problems here?  This is beyond my ken honestly, does
> > anyone know this part of the system well?

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: OpenGL lockups in 2.2

2010-09-13 Thread Robert Green
Jeremy,

It happened to me quite a bit on both 2.1 and 2.2 on every device.
It's surely a defect of Android but so far no one has been able to
track it down.  It's a tough one, very difficult to reproduce
reliably.  It tends to happen more often in certain cases for reasons
unknown to me right now, such as on an EVO running 2.1 on the third
level of Deadly Chambers if you play it straight through.  Since that
takes 20 minutes, it's impossible to figure out by logging because
it's just way too much.  Breakpoints don't work because the game
doesn't run fast enough in debug mode and debugging doesn't work
anyways once the lockup has happened.

It's pretty much a worse case scenario - a very fatal, very
intermittent bug that breaks debugging and is nearly impossible to
isolate.

I hope some genius out there can figure this one out.  I couldn't even
get close.

On Sep 12, 10:34 pm, Jeremy Statz  wrote:
> There's been a couple threads about this in the last year or so, but I
> wanted to draw attention to it again, as I've spent most of the last
> couple of days trying to confirm it wasn't anything I'm doing.
>
> The short story is, I'm pretty sure there's a very serious lock-up-the-
> phone level bug that happens when using OpenGL applications.  When it
> occurs the phone will freeze for at least two minutes before rebooting
> itself, sometimes requiring that the battery be pulled.  This didn't
> seem to happen often on 2.1, but I'm seeing it with a lot more
> regularity on 2.2 (particularly on HTC phones, though that may be a
> coincidence) and am really hoping to draw some attention from someone
> in a position to fix it.  Typically, you'll end up seeing hundreds of
> lines of this in the LogCat log:
>
> WARN/SharedBufferStack(2005): waitForCondition(LockCondition) timed
> out (identity=9, status=0). CPU may be pegged. trying again.
> WARN/SharedBufferStack(71): waitForCondition(LockCondition) timed out
> (identity=9, status=0). CPU may be pegged. trying again.
>
> There won't be any callstack or error of any kind preceding this.  In
> this case 2005 is my app (a live wallpaper), and 71 appears to be the
> UI/system process.  I'm assuming this is a race condition within
> SharedBufferStack.  I've seen cases where four or five process IDs
> were all printing the message, all OpenGL apps of some kind.
>
> Replicating the problem is very, very difficult and seems very
> random... in the last case I had to leave the wallpaper running and
> active on the home screen for about seven hours before it occurred.
> Sometimes I've had it go days, other times it'll happen within a few
> minutes.  My log output demonstrates no unusual activity at all before
> the crash, loading/unloading/visibility/etc doesn't seem to be a
> factor.  It's very rare.
>
> I kind of feel like this got glossed over the last couple times people
> have reported it here, but based on my reading it's a long-standing
> problem with Android and OpenGL and is having a chilling effect on its
> usage.  Is there anyone who can explain if there's anything I can do
> to discourage problems here?  This is beyond my ken honestly, does
> anyone know this part of the system well?

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: OpenGL - 3D rotation from a 2D input

2010-09-09 Thread Robert Green
To switch to ES -  Create an array of verts and normals and use those
to replace the immediate mode drawing.  You will need to replace the
GLU sphere and torus creation with perhaps a known algorithm to create
them - or if you can find a glut es implementation of those that would
work too.


On Sep 9, 4:11 pm, Thiago Lopes Rosa  wrote:
> Lesson 48 ported to Java (still needs some OpenGL ES 
> adjustments):http://www.java-tips.org/other-api-tips/jogl/arcball-rotation-nehe-tu...
>
> Thiago
>
> On Tue, Sep 7, 2010 at 21:04, Thiago Lopes Rosa wrote:
>
>
>
> > Thanks! =)
>
> > Thiago
>
> > On Tue, Sep 7, 2010 at 14:25, Robert Green  wrote:
>
> >> I was going to suggest doing what they outline in that lesson.  In
> >> short - keep a rotation matrix for the current orientation of your
> >> cube.  Process input and keep a rotation matrix that you apply the
> >> user input to, then multiply the cube matrix by and store the result
> >> as the cube matrix, then reset the input matrix to identity and start
> >> all over.
>
> >> For user-space Z input rotation, you can do it like they do in the pro
> >> 3D apps - with a little button that shows that rotation to the left
> >> and to the right.  Still use the same method as above, though, and you
> >> will get very predictable, nice rotation on all axis.
>
> >> On Sep 7, 11:39 am, alan  wrote:
> >> > your first stop for all opengl questions should be NeHe open gl
> >> > lessons:http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=48
>
> >> > On Sep 6, 9:58 pm, Thiago Lopes Rosa  wrote:
>
> >> > > This is a 3D Minesweeper. Instead of searching mines on that
> >> rectangular
> >> > > field, you must search them on several 3D fields (8 in total) by
> >> looking in
> >> > > all faces/planes. So you must rotate the objects to see all sides.
> >> (search
> >> > > for: *3D Mines*)
>
> >> > > I got the idea about different movements for each axis, but I really
> >> wanted
> >> > > to use dragging for all axis.
>
> >> > > Thanks,
>
> >> > > Thiago
>
> >> > > On Mon, Sep 6, 2010 at 17:42, Droid  wrote:
> >> > > > Suggest dragging for x, y and tapping for z axis movement. But its
> >> not
> >> > > > clear exactly what your end-game is
> >> > > > You could also use accelerometer for tipping (see Breakout Legend in
> >> > > > the App in mkt)
>
> >> > > > :) Droid
>
> >> > > > On Sep 6, 7:04 pm, Thiago Lopes Rosa  wrote:
> >> > > > > Hi,
>
> >> > > > > I have a cube on the center of the screen and the user can rotate
> >> it
> >> > > > using
> >> > > > > the touchscreen.
>
> >> > > > > The problem:
> >> > > > > For example, when I rotate the cube 180 degrees (vertical), the
> >> > > > horizontal
> >> > > > > rotation gets "inverted" (i mean, when moving right the cube
> >> rotates left
> >> > > > > and vice-versa).
>
> >> > > > > The issue is that I'm using 2D coordinates (touchscreen) to rotate
> >> the 3D
> >> > > > > cube.
> >> > > > > I'm always rotating around the cube's X and Y axis and never
> >> around the Z
> >> > > > > axis.
>
> >> > > > > The question is:
> >> > > > > How do I calculate how much and which axis to rotate from a 2D
> >> coordinate
> >> > > > > input?
>
> >> > > > > Thanks,
>
> >> > > > > Thiago
>
> >> > > > --
> >> > > > 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+unsubscr...@googlegroups.com >> > > >  cr...@googlegroups.com> >> cr...@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 post to this group, send email to android-developers@googlegroups.com
> >> To unsubscribe from this group, send email to
> >> android-developers+unsubscr...@googlegroups.com >>  cr...@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 post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


  1   2   3   4   5   6   7   >