[android-developers] how to select listview from multiple listviews in main.xml (on Android 2.3.3)

2011-12-25 Thread KK
hi all,
I'm using FrameLayout and have defined two LinearLayouts embedded inside
the FrameLayout. Now for each LinearLayout I've a listview . The problem
I'm facing is picking the two listviews separately from my Java side code.
The default listivew in XML uses the standard defined ID as
*android:id=@id/android:list
*and I'm not able to pick the right one. So I decided to give custom ids to
each of the list view like this in Layout1:
  ListView
android:id=@+id/list1
android:layout_width=fill_parent
android:layout_height=fill_parent /

and the following in Layout2

  ListView
android:id=@+id/list2
android:layout_width=fill_parent
android:layout_height=fill_parent /

and this is what I'm trying to use to pick the listviews separately,

  ListView listView1 = (ListView) findViewById(R.id.list1);
  ListView listView2 = (ListView) findViewById(R.id.list2);

With the above code in pace, I'm not getting any compilation errors. But
during run time I'm getting errors with this message:
*  java.lang.RuntimeException: Your content must have a ListView whose
id attribute is 'android.R.id.list'*

Are we not allowed to use custom IDs for listviews? If custom IDs are not
allowed, then what is the best way to handle the above problem? Would
appreciate if someone could point me to the right direction.

BTW, I'm actually trying to define two layouts each with its own listview
and then I'm trying to animate between two UI screens each using one layout
and the default behavior gives only one of the listivew as picked by
getListView() which happens to be the 1st one, so my 2nd UI page is not
showing any listview.


Thanks,
KK

-- 
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] how to select listview from multiple listviews in main.xml (on Android 2.3.3)

2011-12-25 Thread YuviDroid
Hi,

I believe you are using a ListActivity, which by default looks for a
ListView with id @android:id/list. To use custom ids change that
ListActivity to a normal Activity.


Cheers,
Yuvi
http://www.droidahead.com

On Sun, Dec 25, 2011 at 9:55 AM, KK dioxide.softw...@gmail.com wrote:

 hi all,
 I'm using FrameLayout and have defined two LinearLayouts embedded inside
 the FrameLayout. Now for each LinearLayout I've a listview . The problem
 I'm facing is picking the two listviews separately from my Java side code.
 The default listivew in XML uses the standard defined ID as 
 *android:id=@id/android:list
 *and I'm not able to pick the right one. So I decided to give custom ids
 to each of the list view like this in Layout1:
   ListView
 android:id=@+id/list1
 android:layout_width=fill_parent
 android:layout_height=fill_parent /

 and the following in Layout2

   ListView
 android:id=@+id/list2
 android:layout_width=fill_parent
 android:layout_height=fill_parent /

 and this is what I'm trying to use to pick the listviews separately,

   ListView listView1 = (ListView) findViewById(R.id.list1);
   ListView listView2 = (ListView) findViewById(R.id.list2);

 With the above code in pace, I'm not getting any compilation errors. But
 during run time I'm getting errors with this message:
 *  java.lang.RuntimeException: Your content must have a ListView
 whose id attribute is 'android.R.id.list'*

 Are we not allowed to use custom IDs for listviews? If custom IDs are not
 allowed, then what is the best way to handle the above problem? Would
 appreciate if someone could point me to the right direction.

 BTW, I'm actually trying to define two layouts each with its own listview
 and then I'm trying to animate between two UI screens each using one layout
 and the default behavior gives only one of the listivew as picked by
 getListView() which happens to be the 1st one, so my 2nd UI page is not
 showing any listview.


 Thanks,
 KK

 --
 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




-- 
YuviDroid
Check out Launch-X http://android.yuvalsharon.net/launchx.php (a widget
to quickly access your favorite apps and contacts!)
http://android.yuvalsharon.net

-- 
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] how to select listview from multiple listviews in main.xml (on Android 2.3.3)

2011-12-25 Thread Kostya Vasilyev
It's @android:id/list - NOT @id/android:list.


25 декабря 2011 г. 12:55 пользователь KK dioxide.softw...@gmail.comнаписал:

 hi all,
 I'm using FrameLayout and have defined two LinearLayouts embedded inside
 the FrameLayout. Now for each LinearLayout I've a listview . The problem
 I'm facing is picking the two listviews separately from my Java side code.
 The default listivew in XML uses the standard defined ID as 
 *android:id=@id/android:list
 *and I'm not able to pick the right one. So I decided to give custom ids
 to each of the list view like this in Layout1:
   ListView
 android:id=@+id/list1
 android:layout_width=fill_parent
 android:layout_height=fill_parent /

 and the following in Layout2

   ListView
 android:id=@+id/list2
 android:layout_width=fill_parent
 android:layout_height=fill_parent /

 and this is what I'm trying to use to pick the listviews separately,

   ListView listView1 = (ListView) findViewById(R.id.list1);
   ListView listView2 = (ListView) findViewById(R.id.list2);

 With the above code in pace, I'm not getting any compilation errors. But
 during run time I'm getting errors with this message:
 *  java.lang.RuntimeException: Your content must have a ListView
 whose id attribute is 'android.R.id.list'*

 Are we not allowed to use custom IDs for listviews? If custom IDs are not
 allowed, then what is the best way to handle the above problem? Would
 appreciate if someone could point me to the right direction.

 BTW, I'm actually trying to define two layouts each with its own listview
 and then I'm trying to animate between two UI screens each using one layout
 and the default behavior gives only one of the listivew as picked by
 getListView() which happens to be the 1st one, so my 2nd UI page is not
 showing any listview.


 Thanks,
 KK

 --
 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] how to select listview from multiple listviews in main.xml (on Android 2.3.3)

2011-12-25 Thread KK
Changing ListActivity to just Activity worked like a charm. You are a life
saver. Thanks a lot.

Thanks,
KK

On Sun, Dec 25, 2011 at 3:10 PM, YuviDroid yuvidr...@gmail.com wrote:

 Hi,

 I believe you are using a ListActivity, which by default looks for a
 ListView with id @android:id/list. To use custom ids change that
 ListActivity to a normal Activity.


 Cheers,
 Yuvi
 http://www.droidahead.com

 On Sun, Dec 25, 2011 at 9:55 AM, KK dioxide.softw...@gmail.com wrote:

 hi all,
 I'm using FrameLayout and have defined two LinearLayouts embedded inside
 the FrameLayout. Now for each LinearLayout I've a listview . The problem
 I'm facing is picking the two listviews separately from my Java side code.
 The default listivew in XML uses the standard defined ID as 
 *android:id=@id/android:list
 *and I'm not able to pick the right one. So I decided to give custom ids
 to each of the list view like this in Layout1:
   ListView
 android:id=@+id/list1
 android:layout_width=fill_parent
 android:layout_height=fill_parent /

 and the following in Layout2

   ListView
 android:id=@+id/list2
 android:layout_width=fill_parent
 android:layout_height=fill_parent /

 and this is what I'm trying to use to pick the listviews separately,

   ListView listView1 = (ListView) findViewById(R.id.list1);
   ListView listView2 = (ListView) findViewById(R.id.list2);

 With the above code in pace, I'm not getting any compilation errors. But
 during run time I'm getting errors with this message:
 *  java.lang.RuntimeException: Your content must have a ListView
 whose id attribute is 'android.R.id.list'*

 Are we not allowed to use custom IDs for listviews? If custom IDs are not
 allowed, then what is the best way to handle the above problem? Would
 appreciate if someone could point me to the right direction.

 BTW, I'm actually trying to define two layouts each with its own listview
 and then I'm trying to animate between two UI screens each using one layout
 and the default behavior gives only one of the listivew as picked by
 getListView() which happens to be the 1st one, so my 2nd UI page is not
 showing any listview.


 Thanks,
 KK

 --
 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




 --
 YuviDroid
 Check out Launch-X http://android.yuvalsharon.net/launchx.php (a widget
 to quickly access your favorite apps and contacts!)
 http://android.yuvalsharon.net

  --
 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: Android custom ImageView fade animation

2011-12-25 Thread Seb
But can I still define my animations in XML using your suggested
method?

On Dec 24, 6:27 pm, AlexBonel bonela...@gmail.com wrote:
 On 23 дек, 07:49, Seb stsiop...@googlemail.com wrote:

  Brilliant, that's useful, will give that a go. Any advice for the
  original issue?

 Well, I have got only one idea, but I think there is another better
 method to do, but never mind, try to call
 Activity.runOnUIThread(Runnable) method and pass there a Runnable
 whereanimationwould be launched.

-- 
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] Google Earth for android apps

2011-12-25 Thread Raju Gaddam
Hi  please tell me how to integrate Google Earth with android application

-- 
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] Google Earth for android apps

2011-12-25 Thread Kristopher Micinski
I do not believe that Google Earth has an Android API.

kris

On Sun, Dec 25, 2011 at 6:34 AM, Raju Gaddam gaddam967...@gmail.com wrote:
 Hi  please tell me how to integrate Google Earth with android application


 --
 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: Android custom ImageView fade animation

2011-12-25 Thread AlexBonel


On 25 дек, 15:31, Seb stsiop...@googlemail.com wrote:
 But can I still define my animations in XML using your suggested
 method?

Yeah, Why not, just call static AnimationUtils.() with context
instance (which is your Activity) and id of your animation xml and
it'll return you Animation object that you can pass to your
startAnimation() method

-- 
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] out of memory

2011-12-25 Thread ANKUR GOEL
Hi all ,

google nexux is giving lot of out of memory exception but when i run my
sample in other devices it runs perfectly fine 

So anybody can help me what might be the problem with nexus .:(


Thanks and 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] Using multiple listview inside one activity, how to give focus to each

2011-12-25 Thread KK
hi All,
I'm using multiple listViews inside one activity. I'm using each listiview
in its own UI screen layout, meaning I've two UI screens. Now when I start
the app, I get the focus on the first app as I'm able to scroll down/up the
list and when I switch to the 2nd listview in the 2nd UI screen, the second
listView works fine and I'm able to scroll the list. Next, when I return
back from the 2nd listview UI screen page to the first page screen, the
list becomes static/freezed and I'm not able to scroll up/down but
surprisingly when I return back to the 2nd listView, it still works fine.
I'm not able to understand as to why both the listViews work fine initially
but after returning back from the 2nd listView the 1st listView stops
working/scrolling. To me it feels as if something is locked in 1st
listView, when I'm returning back from the 2nd one and we've to enable some
short of flag, by saying enable this listView from scrolling/usage as
currently this listView is in focus on screen. Would appreciate if someone
could point me to the right direction. I'm adding some code snippets below,

--
Activity file code snippet
--

layout01 = (LinearLayout) findViewById(R.id.Layout1);
  layout02 = (LinearLayout) findViewById(R.id.Layout2);
  layout02.setVisibility(View.GONE);

..
listView1 = (ListView) findViewById(R.id.list1);
  listView2 = (ListView) findViewById(R.id.list2);

this.adapter = new MovieAdapter(this);
  listView1.setAdapter(this.adapter);
  listView1.setItemsCanFocus(false);

  listView2.setAdapter(new MovieAdapter(this));
  listView2.setItemsCanFocus(false);



-
main.xml layout file:
-
FrameLayout xmlns:android=http://schemas.android.com/apk/res/android;
android:id=@+id/container
android:layout_width=fill_parent
android:layout_height=fill_parent 

LinearLayout
xmlns:android=http://schemas.android.com/apk/res/android;
android:id=@+id/Layout1
android:layout_width=fill_parent
android:layout_height=fill_parent
android:orientation=vertical 

ImageView
android:layout_width=fill_parent
android:layout_height=75px
android:scaleType=fitXY
android:src=@drawable/title /



ListView
android:id=@+id/list1
android:layout_width=fill_parent
android:layout_height=fill_parent /

/LinearLayout

LinearLayout
android:id=@+id/Layout2
android:layout_width=fill_parent
android:layout_height=fill_parent
android:orientation=vertical 

ImageView
android:layout_width=fill_parent
android:layout_height=75px
android:scaleType=fitXY
android:src=@drawable/title /


ListView
android:id=@+id/list2
android:layout_width=fill_parent
android:layout_height=fill_parent /


/LinearLayout

/FrameLayout



Appreciate your time.

Thanks,
KK

-- 
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] Forwarding a stream to be accessible from an URL. Idea needed.

2011-12-25 Thread Krzysztof Głodowski
Hello,
I'm going to implement media streaming in my app, but I'm not sure
what is the best approach for this.

First of all, I have access to InputStreams from several sources, like
SMB network or a ZIP file. Let's say, those streams refer to some
media, for example an mp3 file.
What I want to achieve, is to forward those streams to the localhost,
to be accessible from an URL to other apps. Something like http://
localhost:4567/my_media.mp3.
After that, I want to list all activities, that can play my media
using that URL, i.e. some streaming apps installed in the system. I
just want them to still think that this url refers to some media in
the Internet.

I know how to do activity listing, but I am unable to find any good
idea for the first part. What is the best way to achieve that? Any
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: out of memory

2011-12-25 Thread John Coryat
We were seeing this a lot too on the new Nexus but then the update came out 
and I haven't seen one since. Make sure you're running the more recent 
release of ICS. That seems to have solved the problem for us.

-John Coryat

-- 
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: out of memory

2011-12-25 Thread AndroidYourself
Same here.

This is a default memory bug. Nexus has 1 GB Ram... but default app
memory limit is 16 MB :)

-- 
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] OpenGL ES 2.0 weirdness - app works on Samsung Galaxy S2, but not Nexus One or HTC Desire

2011-12-25 Thread Michael
I have an app which uses OpengGL ES 2.0 which works fine on my Galaxy
S2, but only displays a black screen on the Nexus One and HTC Desire.
The logs report no errors.  Are there known differences between the
Samsung Galaxy S2 OpenGL ES 2.0 implementation and that of other
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


Re: [android-developers] OpenGL ES 2.0 weirdness - app works on Samsung Galaxy S2, but not Nexus One or HTC Desire

2011-12-25 Thread Christopher Van Kirk
There are many, many differences between devices when it comes to OpenGL 
ES 2.0 rendering. It's a profound problem, actually, because it more or 
less demands that you either buy each kind of device for testing (and 
there are 600+ devices), or buy graphics engine from someone else who 
has...neither of which are particularly palatable options from an 
expense perspective because the value of the app is likely to be far 
less than the cost of the tool or devices needed to test it.


On 12/26/2011 9:34 AM, Michael wrote:

I have an app which uses OpengGL ES 2.0 which works fine on my Galaxy
S2, but only displays a black screen on the Nexus One and HTC Desire.
The logs report no errors.  Are there known differences between the
Samsung Galaxy S2 OpenGL ES 2.0 implementation and that of other
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: Fail to connect to camera service

2011-12-25 Thread Pedro Teixeira
I'm sorry to come up with this subject again but we're going to the
end of December and I'm still stuck in this..it's so demotivating.
I've tried to reach wikitude developers but they don't know how to
help me so if you have the patience or will to give me some
suggestions on this I would be really gratefull. I'll try to explain
with the code to make the things more clear.

I have an activity called BasicOpenARDemoActivity (wikitude activity
that initiates a wikitude camera view) with a method to happen when
the location is changed. If there's a certain proximity to a target a
trigger is called which opens a new intent:

public void onLocationChanged(Location newLocation) {

double picLatitude = Double.parseDouble(picLatitudeString);
double picLongitude = Double.parseDouble(picLongitudeString);
double myLatitude  =  (newLocation.getLatitude());
double myLongitude =  (newLocation.getLongitude());

float R = 6371; // km
float dLat = (float) Math.toRadians((picLatitude-myLatitude));
float dLon = (float) Math.toRadians((picLongitude-myLongitude));
float a = (float) (Math.sin(dLat/2) * Math.sin(dLat/2) +
   Math.cos(Math.toRadians(myLatitude)) *
Math.cos(Math.toRadians(picLatitude)) *
   Math.sin(dLon/2) * Math.sin(dLon/2));
float c = (float) (2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)));
float distancia = R * c;

// distancia in KM
if(distancia0.05  ar.equals(1)){
LogToSD.write(AR:, PROXIMITY ALERT);

Intent TNNIntent = new Intent(this.getBaseContext(),
thenNnowMode.class);
Bundle w = new Bundle();
activityName=finding;
w.putString(code, activityName);
w.putString(piclink, picLink);
w.putString(sd, picSD);
w.putString(id, picId);
w.putString(ar, ar);
w.putString(latitude, picLatitudeString);
w.putString(longitude, picLongitudeString);
w.putString(orientation, picOrientationString);
TNNIntent.putExtras(w);
startActivity(TNNIntent);
finish();
}

The activity called after the trigger happens is called thenNnowMode
which initiates a surfaceview and the native camera of android:

Bundle w = getIntent().getExtras();
if (w!=null){
activityName = w.getString(code);
 if(activityName.equals(finding)){
picId = w.getString(id);
picSD = w.getString(sd);
picDate = w.getString(date);
picKeywords = w.getString(keywords);
picComment = w.getString(comment);
picLink = w.getString(piclink);
piclatitudeString = w.getString(latitude);
piclongitudeString = w.getString(longitude);
picorientationString = w.getString(orientation);
ar = w.getString(ar);
if (ar.equals(1)){
TNNPicture = BitmapFactory.decodeFile(picSD);
transparencyPreview = (ImageView) 
findViewById(R.id.picture);
transparencyPreview.setImageBitmap(TNNPicture);
transparencyPreview.setAlpha(150);

}
}else{
  picId = w.getString(id);
  TNNPicturePath = w.getString(path);
 }
}

A SurfaceView is created  on the method onCreate() (I use it to be
able to TAP the screen and take a picture)

tnnSurfaceView = (TappableSurfaceView)
findViewById(R.id.surface_camera);
mSurfaceHolder = tnnSurfaceView.getHolder();
mSurfaceHolder.addCallback(this);
mSurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
tnnSurfaceView.addTapListener(onTap);

SurfaceView methods

@Override
// Create the Surface and Open the Camera
public void surfaceCreated(SurfaceHolder holder) {
tnnCamera = Camera.open();
}

@Override
// Reacts for camera changes
public void surfaceChanged(SurfaceHolder holder, int format, int
w,int h) {
if (mPreviewRunning) {
tnnCamera.stopPreview();
}
Camera.Parameters p = tnnCamera.getParameters();
p.setPreviewSize(w, h);
tnnCamera.setParameters(p);
try {
tnnCamera.setPreviewDisplay(holder);
} catch (IOException e) {
e.printStackTrace();
}
tnnCamera.startPreview();
mPreviewRunning = true;
}

@Override
// When the camera is closed
public void surfaceDestroyed(SurfaceHolder holder) {
mPreviewRunning = false;
tnnCamera.setPreviewCallback(null);
 

[android-developers] Re: OpenGL ES 2.0 weirdness - app works on Samsung Galaxy S2, but not Nexus One or HTC Desire

2011-12-25 Thread Michael
Perhaps I should give more information about what the app is doing.
It uses a single 1024*1024 texture with type GL_UNSIGNED_BYTE.  It
runs a shader on the texture to perform a palette-shifting animation.
The shader compiles without errors, even on the devices where the app
doesn't work.

On Dec 25, 8:47 pm, Christopher Van Kirk
christopher.vank...@gmail.com wrote:
 There are many, many differences between devices when it comes to OpenGL
 ES 2.0 rendering. It's a profound problem, actually, because it more or
 less demands that you either buy each kind of device for testing (and
 there are 600+ devices), or buy graphics engine from someone else who
 has...neither of which are particularly palatable options from an
 expense perspective because the value of the app is likely to be far
 less than the cost of the tool or devices needed to test it.

 On 12/26/2011 9:34 AM, Michael wrote:







  I have an app which uses OpengGL ES 2.0 which works fine on my Galaxy
  S2, but only displays a black screen on the Nexus One and HTC Desire.
  The logs report no errors.  Are there known differences between the
  Samsung Galaxy S2 OpenGL ES 2.0 implementation and that of other
  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


Re: [android-developers] Re: OpenGL ES 2.0 weirdness - app works on Samsung Galaxy S2, but not Nexus One or HTC Desire

2011-12-25 Thread Christopher Van Kirk
1) I would check every GL call's error code after you run it to make 
sure nothing is reporting an error. If the shader is compiling chances 
are good that it's okay (there are exceptions).


2) Different devices handle texture unit mappings in different ways. 
I've had problems binding a texture to a unit and leaving it there. I 
found that re-binding the texture unit every time I use the shader seems 
to be portable, if not particularly desirable. Having said that, I 
haven't found a way to get my own app to run on the PowerVR 
chips...so...who knows.


3) Check that your really giving it the texture format that you think 
you are. I remember having problems with the SGS 2 because some textures 
needed to be bound as 565 instead of unsigned byte.


The bad news is that there's really no repository of knowledge for this 
stuff. You just have to slog through it by yourself or buy an engine 
that has done it for you. Unfortunate, and unhealthy for Android, but 
that's just the way it is with Android OpenGL. Fragmentation at its most 
diabolical.


On 12/26/2011 10:33 AM, Michael wrote:

Perhaps I should give more information about what the app is doing.
It uses a single 1024*1024 texture with type GL_UNSIGNED_BYTE.  It
runs a shader on the texture to perform a palette-shifting animation.
The shader compiles without errors, even on the devices where the app
doesn't work.

On Dec 25, 8:47 pm, Christopher Van Kirk
christopher.vank...@gmail.com  wrote:

There are many, many differences between devices when it comes to OpenGL
ES 2.0 rendering. It's a profound problem, actually, because it more or
less demands that you either buy each kind of device for testing (and
there are 600+ devices), or buy graphics engine from someone else who
has...neither of which are particularly palatable options from an
expense perspective because the value of the app is likely to be far
less than the cost of the tool or devices needed to test it.

On 12/26/2011 9:34 AM, Michael wrote:








I have an app which uses OpengGL ES 2.0 which works fine on my Galaxy
S2, but only displays a black screen on the Nexus One and HTC Desire.
The logs report no errors.  Are there known differences between the
Samsung Galaxy S2 OpenGL ES 2.0 implementation and that of other
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] best online jobs

2011-12-25 Thread brisk67 brisk67
Best Online Jobs
http://gsonlinejobs.yolasite.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] Android onLayout() and AsyncTask() does not work together

2011-12-25 Thread Binh Nguyen
Hi experts,

I need a scrollable table with fixed header, so I followed this great
blog (http://blog.stylingandroid.com/archives/432) and everything is
fine.

The idea is using one table for header, one table for content added in
scrollview, both of them are in a customized LinearLayout. In
customized LinearLayout, we will overwrite the onLayout() to get the
max width of each row and set width for each row of both header and
content table.

Here is the activity and its layout:

package com.stylingandroid.ScrollingTable;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TableLayout;
import android.widget.TableRow;

public class ScrollingTable extends LinearLayout
{
public ScrollingTable( Context context )
{
super( context );
}
public ScrollingTable( Context context, AttributeSet attrs )
{
super( context, attrs );
}

@Override
protected void onLayout( boolean changed, int l, int t, int r, int b )
{
super.onLayout( changed, l, t, r, b );

TableLayout header = (TableLayout)
findViewById( R.id.HeaderTable );
TableLayout body = (TableLayout) findViewById( R.id.BodyTable );

if (body.getChildCount()  0 ) {
TableRow bodyRow = (TableRow) body.getChildAt(0);
TableRow headerRow = (TableRow) header.getChildAt(0);

for ( int cellnum = 0; cellnum  bodyRow.getChildCount();
cellnum++ ){
View bodyCell = bodyRow.getChildAt(cellnum);
View headerCell = headerRow.getChildAt(cellnum);
int bodyWidth = bodyCell.getWidth();
int headerWidth = headerCell.getWidth();
int max = Math.max(bodyWidth, headerWidth);
TableRow.LayoutParams bodyParams =
(TableRow.LayoutParams)bodyCell.getLayoutParams();
bodyParams.width = max;
TableRow.LayoutParams headerParams =
(TableRow.LayoutParams)headerCell.getLayoutParams();
headerParams.width = max;
}
}
}
}

main.xml
===

 ?xml version=1.0 encoding=utf-8?
LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:orientation=vertical
android:layout_width=fill_parent
android:layout_height=fill_parent

com.stylingandroid.ScrollingTable.ScrollingTable
android:layout_width=match_parent
android:orientation=vertical
android:layout_height=match_parent

TableLayout
android:layout_height=wrap_content
android:layout_width=match_parent
android:id=@+id/HeaderTable
/TableLayout

ScrollView
android:layout_width=match_parent
android:layout_height=wrap_content

TableLayout
android:layout_height=wrap_content
android:layout_width=match_parent
android:id=@+id/BodyTable
/TableLayout

/ScrollView

/com.stylingandroid.ScrollingTable.ScrollingTable

/LinearLayout

Main activity
==

package com.stylingandroid.ScrollingTable;

import android.app.Activity;
import android.app.ProgressDialog;
import android.graphics.Color;
import android.os.AsyncTask;
import android.os.Bundle;
import android.widget.TableLayout;
import android.widget.TableRow;

import android.widget.TextView;

public class ScrollingTableActivity extends Activity
{
private String[][] tableData = {
{header111, header2,header3,header4},
{column1, column1,column1,column1},
{column1, column1,column1,column1},
{column1, column1,column1,column1},


{column1, column1,

column1,column1},
{column1, column1,column1,column1},
{column1, column1,column1,column1},
{column1, column1,column1,column1},
{column1, column1,column1,column1},
{column1, column1,column1,column1},
{column1, column1,column1,column1},
{column1, column1,column1,column1},
{column1, column1,column1,column1}
};
/** Called when the activity is first created. */
@Override
public void onCreate( Bundle savedInstanceState )
{
super.onCreate( savedInstanceState );
setContentView( R.layout.main );
TableLayout tableHeader =
(TableLayout)findViewById(R.id.HeaderTable);
TableLayout tableBody =
(TableLayout)findViewById(R.id.BodyTable);

appendRows(tableHeader, tableBody, tableData);
}

private void appendRows(TableLayout tableHeader ,TableLayout
tableContent, String[][] amortization) {
int rowSize=amortization.length;
int colSize=(amortization.length  0)?amortization[0].length:0;
for(int i=0; irowSize; i++) {
TableRow row1 = new TableRow(this);

for(int j=0; jcolSize; j++) {
TextView c = new TextView(this);
c.setText(amortization[i][j]);
   

[android-developers] Re: How to pair two devices to transfer file over Bluetooth using NFC

2011-12-25 Thread tarun sablok
i am using  createInsecureRfcommSocketToServiceRecord()  function to
create the socket and here is the description what it says about
function in Android developers ...



public BluetoothSocket createInsecureRfcommSocketToServiceRecord (UUID
uuid)
Since: API Level 10 Create an RFCOMM BluetoothSocket socket ready to
start an insecure outgoing connection to this remote device using SDP
lookup of uuid.

The communication channel will not have an authenticated link key i.e
it will be subject to man-in-the-middle attacks. For Bluetooth 2.1
devices, the link key will be encrypted, as encryption is mandatory.
For legacy devices (pre Bluetooth 2.1 devices) the link key will be
not be encrypted. Use createRfcommSocketToServiceRecord(UUID) if an
encrypted and authenticated communication channel is desired.

This is designed to be used with
listenUsingInsecureRfcommWithServiceRecord(String, UUID) for peer-peer
Bluetooth applications.

Use connect() to initiate the outgoing connection. This will also
perform an SDP lookup of the given uuid to determine which channel to
connect to.

The remote device will be authenticated and communication on this
socket will be encrypted.

Hint: If you are connecting to a Bluetooth serial board then try using
the well-known SPP UUID 1101--1000-8000-00805F9B34FB. However
if you are connecting to an Android peer then please generate your own
unique UUID.

Requires BLUETOOTH

Parameters
uuid  service record uuid to lookup RFCOMM channel

Returns
a RFCOMM BluetoothServerSocket ready for an outgoing connection
Throws
IOException  on error, for example Bluetooth not available, or
insufficient permissions



On Dec 22, 5:27 pm, lbendlin l...@bendlin.us wrote:
  Everything is working fine but i am getting a pairing request or to
  match the keys on both the phones which should not come.

 How do you know if both devices support unsecure connections? They may just
 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] how can we get the notification of sending message

2011-12-25 Thread surabhi jain
hi

I want to get the notification when i will send a message from my device.

thanx to all

-- 
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] how can we get the notification of sending message

2011-12-25 Thread TreKing
On Mon, Dec 26, 2011 at 12:55 AM, surabhi jain surabhi17.j...@gmail.comwrote:

 I want to get the notification when i will send a message from my device.


What is the notification?
What is a message?

-
TreKing http://sites.google.com/site/rezmobileapps/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