[android-developers] WifiManager: Can't activate WiFi Hotspot with Android > v7.1

2017-09-18 Thread Jens Doose
 

We use a method of the WifiManager to open and close a WiFi Hotspot.
An external device (navi) connect via Bluetooth an Android smartphone and 
then our app open a WiFi hotspot.
After this, die navi have connection to the internet via the smartphone 
WiFi hotspot.


It works until Android 7.0.
Since Android 7.1 (and upper) it does not work, because the DHCP Service 
doesn't start (we think). 

My code snippet:
*WifiManager mWifiManager = (WifiManager) 
this.context.getSystemService(Context.WIFI_SERVICE);*


* Method method = mWifiManager.getClass().getMethod("setWifiApEnabled", 
WifiConfiguration.class, boolean.class); method.invoke(mWifiManager, 
wifiConfig, enabled); *


We test the Method ConnectivityManager::startTethering. But in this case 
the app needs MANAGE_USERS rights, but that is not possible for our app. 


Is there another class or method to activate the WiFi Hotspot?


-- 
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/b9da4c06-724d-4ebf-b512-4fd01f8e0e87%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Problems using YouTubePlayerFragment, “the YouTubePlayerView is 0dp wide and 0dp high”

2016-05-27 Thread Jens Wangenheim
I am really struggling with using the `YouTubePlayerFragment` in my 
application. My implementation looks like this:

private void loadYouTubeVideo(final YouTubeViewHolder h, final Content 
content) {
final YouTubePlayerFragment youTubePlayerFragment = 
YouTubePlayerFragment.newInstance();
FragmentTransaction transaction = ((DetailActivity) 
getContext()).getFragmentManager().beginTransaction();
transaction.add(R.id.fl_youtube, youTubePlayerFragment).commit();
final ViewTreeObserver observer = h.mRlYouTube.getViewTreeObserver();
observer.addOnGlobalLayoutListener(new 
ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
youTubePlayerFragment.initialize(YOUTUBE_PLAYER_API_KEY, new 
YouTubePlayer.OnInitializedListener() {
@Override
public void onInitializationSuccess(YouTubePlayer.Provider provider, 
YouTubePlayer youTubePlayer, boolean wasRestored) {
if(!wasRestored) {
  
 youTubePlayer.setPlayerStyle(YouTubePlayer.PlayerStyle.DEFAULT);
youTubePlayer.loadVideo(content.getVideoId());
}
}

@Override
public void onInitializationFailure(YouTubePlayer.Provider provider, 
YouTubeInitializationResult youTubeInitializationResult) {
Log.e(getClass().getSimpleName(), "Error initializing YouTube Video 
with id ");
FragmentTransaction transaction = ((DetailActivity) 
getContext()).getFragmentManager().beginTransaction();
transaction.remove(youTubePlayerFragment);
}
});
}
});
}

The initialization is no problem, as a YouTubePlayer is displayed and the 
video is loaded. But it immediately stops after one second with the 
following message:

"YouTube video playback stopped due to the player's view being too 
small. The YouTubePlayerView is 0dp wide (minimum is 200dp) and 0dp high 
(minimum is 110dp)."

This is the XML layout with the `FrameLayout`, to which I add the 
`YouTubePlayerFragment` in the code above:


http://schemas.android.com/apk/res/android;
android:id="@+id/fl_youtube"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:minWidth="200dp"
android:minHeight="110dp"
android:layout_marginBottom="5dp"
>



I have no idea why the YouTubePlayer pretends to have width and height 0. 
When I log the size of the FrameLayout, its height is 607 and its width is 
1080 px. Any ideas how to solve this problem?

-- 
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/d1fb0f12-8803-40d3-842e-08c4b52c8f52%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] android.provider.Settings.System.FONT_SCALE -- Does this do anything (Android 2.0)?

2012-08-25 Thread Jens
...now, on Android 4.1.1 the following method still does NOT update the 
system's font scale:

Settings.System.putFloat( getContentResolver(), Settings.System.FONT_SCALE, 
newFontScale );

Any ideas?


On Friday, 13 November 2009 00:34:03 UTC+1, Romain Guy wrote:

 It's supposed to scale the size of fonts defined using the sp unit. 
 But this is not exposed to the user not really supported at the 
 moment. 

 On Thu, Nov 12, 2009 at 2:54 PM, Colin Brash 
 colin...@gmail.comjavascript: 
 wrote: 
  I've been playing around on Android 2.0 trying to globally change font 
  sizes.  I call the following: 
  
  Settings.System.putString(getContentResolver(), 
  Settings.System.FONT_SCALE, scale); 
  
  This does change FONT_SCALE, but the changed value seems to have no 
  effect on the system. 
  
  What does this actually do (if anything)? 
  
  Thanks, 
  Colin 
  
  -- 
  You received this message because you are subscribed to the Google 
  Groups Android Developers group. 
  To post to this group, send email to 
  android-d...@googlegroups.comjavascript: 
  To unsubscribe from this group, send email to 
  android-developers+unsubscr...@googlegroups.com javascript: 
  For more options, visit this group at 
  http://groups.google.com/group/android-developers?hl=en 
  



 -- 
 Romain Guy 
 Android framework engineer 
 roma...@android.com javascript: 

 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: E/dalvikvm: Could not find class 'xxx', referenced from method yyy

2012-04-10 Thread Jens Axelsson
I have the same issue. Even just following the example
https://developers.google.com/mobile-ads-sdk/docs/android/fundamentals
I get 04-05 22:31:17.203: E/dalvikvm(28635): Could not find class
'com.google.ads.AdView', referenced from method
se.phidev.yxa.YxaActivity.onCreate, this was working fine until I
upgraded to ADT-17.

On 4 Apr, 17:56, Steve steveyzh...@gmail.com wrote:
 I met this issue too. I can't find the way to work around or fix it
 Anyone can help me?







 On Friday, March 9, 2012 6:46:15 PM UTC+8, alex2k8 wrote:

  I have migrated to adt-17-preview (http://tools.android.com/download/
  adt-17-preview http://tools.android.com/download/adt-17-preview),
  because I had issues (http://code.google.com/p/
  android/issues/detail?id=21031http://code.google.com/p/android/issues/detail?id=21031)
  with previous versions... Now I have
  such setup:

  ProjC - ProjB - ProjA

  Where

    ProjA: Java Project

    ProjB: Android Library
      - Properties  Android  Library  [x] Is Library
      - Properties  Java Build Path  Projects  ProjA

    ProjC: Android Project
      - Properties  Android  Library: ProjB
      - Properties  Java Build Path  Projects  ProjA

  ProjA has:

      public class A {
          public void m1() {}
      }

  ProjB has:

      public class B {
          public void m1() {
              new A().m1();
          }
      }

  ProjC has:

      public void onCreate(Bundle savedInstanceState) {
          ...
          B b = new B();
          b.m1();
      }

  The application crashes with such errors:

  03-09 14:33:05.730: E/dalvikvm(6508): Could not find class
  'com.test.A', referenced from method com.test.B.m1
  03-09 14:33:05.730: W/dalvikvm(6508): VFY: unable to resolve new-
  instance 5 (Lcom/test/A;) in Lcom/test/B;
  03-09 14:33:05.730: D/dalvikvm(6508): VFY: replacing opcode 0x22 at
  0x
  03-09 14:33:05.730: D/dalvikvm(6508): DexOpt: unable to opt direct
  call 0x0004 at 0x02 in Lcom/test/B;.m1
  03-09 14:33:05.730: D/AndroidRuntime(6508): Shutting down VM
  03-09 14:33:05.730: W/dalvikvm(6508): threadid=1: thread exiting with
  uncaught exception (group=0x40a3b1f8)
  03-09 14:33:05.740: E/AndroidRuntime(6508): FATAL EXCEPTION: main
  03-09 14:33:05.740: E/AndroidRuntime(6508):
  java.lang.NoClassDefFoundError: com.test.A
  03-09 14:33:05.740: E/AndroidRuntime(6508):         at
  com.test.B.m1(B.java:
  6)
  03-09 14:33:05.740: E/AndroidRuntime(6508):         at
  com.test.MainActivity.onCreate(MainActivity.java:14)

  Q: What can I do to fix this error?

-- 
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 to install both applications using 1 apk file?

2011-09-29 Thread Jens
If you mean add/bind the widget to the users Homescreen by
installing that is not supported for non-system/signed applications.
Otherwise, do as Mark said and put them both in the same APK.

On Sep 23, 2:59 pm, Oleksandr Fesak oleksandr.fe...@gmail.com wrote:
 Additionally to main application I need to install a widget
 application.
 Actually I have 2 apk files (for main application and for widget
 application). I need that this 2 applications to be installed from one
 apk package. Please suggest how to accomplish this task.

-- 
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 is worst os mobile is this true

2011-09-22 Thread Jens
Let's assume that 3.x is not suitable for mobile phones.

If Google were to release 3.x you can take your pick of the available
3rd world Asian countries that would be putting 3.x in shitty low-end
mobile phones.

Result: Bad-will against Google for putting out such a horrible
product that doesn't work on mobile phones.

sarcasmOr, they could just be so greedy that they want to keep that
lucrative Android fondleslab market for themselves .. oh right, no,
they don't even make a fondleslab/sarcasm


On Sep 22, 1:34 am, Indicator Veritatis mej1...@yahoo.com wrote:
 I never understood the logic behind that decision: why isn't the 3.x
 code being open sourced just like the others? It leaves one doubting
 Google's word, when they say, We wanted to make sure that there was
 no central point of failure...  why we created Android, and made its
 source code open.

 For if that were the real and full reason, then Honeycomb would be
 open too.

 On Sep 21, 4:26 pm, Rogério de Souza Moraes rogerio.so...@gmail.com
 wrote:

  I agree that the Android for me is the best choice for a phone OS and you
  can download the code from 1.x until 2.x, but I think we will never the 3.x
  codes. With some lucky they will release the 4.x codes without much delay.

  2011/9/21 Richard Schilling coderroa...@gmail.com

   Sorry you feel this way.

   There are lots of Android developers on this list, so I'm sure someone
   heard you.  In fact, you can be one!

   You're welcome to download the code and make changes that you feel should
   be there.

   Richard

   --
   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: Always getting GET on the server eventhough POST was sent

2011-09-22 Thread Jens
Well, for a starter your #addHeader(Content-Type, application/
json) doesn't really make sense since you're in fact sending
application/x-www-form-urlencoded when you're pushing an
UrlEncodedFormEntity to the server - otherwise it looks about right.

Are you getting a HTTP 3xx redirect - that could .. result in a GET..
I guess? You can disable processing of redirects with
HttpClientParams.setRedirecting(.., false) and see if it breaks in new
and interesting ways then.

On 22 Sep, 16:44, Joshua Partogi joshua.part...@gmail.com wrote:
 Hi there,

 I am trying to send data using POST method from my android apps. However in
 the server it is always recognized as GET. I am using Rails apps as the web
 service. Here is the snippet of my Android code:

  URI uri = new URI(hostName);

 HttpPost httpRequest = new HttpPost(uri);

  httpRequest.addHeader(Accept, application/json);

  httpRequest.addHeader(Content-Type, application/json);

  ListNameValuePair pairs = new ArrayListNameValuePair();

  pairs.add(new BasicNameValuePair(key1, value1));

  httpRequest.setEntity(new UrlEncodedFormEntity(pairs));

 HttpClient httpClient = new DefaultHttpClient();

 HttpResponse httpResponse = httpClient.execute(httpRequest);

 Have I done anything wrong? Thanks for your help.

 Kind regards,
 Joshua.

 --
 @jpartogi

-- 
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 to show numbers before each string in ListView

2011-09-22 Thread Jens
Assuming that you are using a SimpleCursorAdapter you should look into
using a SimpleCursorAdapter.ViewBinder and maybe a custom list item
layout - useful if you want to further dress up your list in the
future.

http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/List3.html

When you implement the ViewBinder method #setViewValue(View view,
Cursor cursor, int columnIndex) you can obtain the index of your song
(in the list returned from Sqlite) by calling Cursor#getPosition().

Works about the same-ish for other adapters also.

On 22 Sep, 17:08, KK dioxide.softw...@gmail.com wrote:
 Hi All,
 I'm just trying to list song items and displaying it to user for selection.
 I'm using the following ListView for this purposes:

 ListView android:id=@id/android:list
               android:layout_width=fill_parent
               android:layout_height=fill_parent
               android:layout_weight=1
               android:drawSelectorOnTop=false/

 and this list down the songs like this:
 songa
 songb
 songc

 Is there any option maybe shomething like android:numericlist which will
 list the songs like this:
 1.songa
 2.songb
 3.songc

 Or may be some other elegant yet simple way to achieve the same effect.

 Any help would be highly appreciated.

 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] Re: How to insert special character into Database

2011-09-21 Thread Jens
One hint: MITHUL'S

http://www.sqlite.org/faq.html#q14

Or .. you know .. you could stop doing hardcoded queries and use the
supporting functionality present in Android.

On Sep 21, 8:44 am, Bishan tvbis...@gmail.com wrote:
 @  Zsolt
 no. i got this error.

 09-21 12:07:26.876: INFO/Database(19855): sqlite returned: error code
 = 1, msg = near S: syntax error

 09-21 12:07:26.876: ERROR/Database(19855): Failure 1 (near S: syntax
 error) on 0x2ae178 when preparing 'INSERT INTO Client VALUES
 ('110003', 'MITHUL'S ', 'R1', '3', '0', 'HOTEL', 'BRONZ', '4', '3',
 'MAIN ROAD', 'AAA', 'SSS', '1091', 'weqwe', 'Y')'.

 On 9/21/11, Zsolt Vasvari zvasv...@gmail.com wrote:

  It's all Unicode, all characters are created equal.

  On Sep 21, 1:38 pm, Bishan tvbis...@gmail.com wrote:
  How to insert ' character or special character into Database using sqlite
  ?

  --
  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: Publish and Debug

2011-09-21 Thread Jens


leonardomasc...@gmail.com wrote:
 I really have to unsintall the market downloaded apk to run the debug?

No.

 or there is another way to do this?

Yes.

Four easy steps to compromise security:
1. Whip out Portecle (http://portecle.sourceforge.net, no install
required).
2. MAKE A COPY OF YOUR SIGNING KEYSTORE.
3. Use Portecle to rename the key or create a new keystore that
contains your signing key - but now with the name androiddebug and
the password android.
4. Replace your debug keystore with this brand spanking new keystore
and presto - you are debug signing your apps with the same key.

This is of course a *horrifically* bad idea security wise - but fun
nonetheless.

-- 
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: ViewFlipper class does not support SurfaceView like it should

2011-09-20 Thread Jens
That would be the gist of what both Dianne  Romain Guy said yes.

On Sep 20, 2:13 pm, MobileVisuals eyv...@astralvisuals.com wrote:
 GLSurfaceView extends SurfaceView. Does that mean that it is not
 possible to animate GLSurfaceView with a viewflipper?

 On Sep 20, 9:54 am, Romain Guy romain...@android.com wrote:

  You can animate another view on top of a SurfaceView, you just cannot
  animate the SurfaceView itself.

  On Tue, Sep 20, 2011 at 12:51 AM, MobileVisuals 
  eyv...@astralvisuals.comwrote:

   Thanks for the info, I have spent many hours investigating this issue
   and now I finally know what the problem is. My app has a standard 2d
   menu. It is possible to view different 3d visual effects from the
   menu. The 3d visual effects are rendered in a GLSurfaceView. That
   class extends SurfaceView.

   You say that SurfaceView should not be used in a ViewFlipper. How can
   I implement my app if I can't use SurfaceView or GLSurfaceView? Which
   type of view should I use for the ViewFlipper? Can I render the 3d
   visual effects with other views than GLSurfaceView?

   Or shouldn't I use a ViewFlipper at all? If not, how can I then switch
   between the 2d and the 3d rendering?

   On Sep 19, 7:37 pm, Dianne Hackborn hack...@android.com wrote:
Don't use a SurfaceView in a ViewFlipper.

Nor a ListView.

SurfaceView is a *very* *special* view.  As it says, what it does is
   create
a completely separate surface (a.k.a. window) that is associated with
   your
main window.  This window is positioned behind the main window, and a
   hole
punched through your main window to see the surface behind.

By its nature, this makes the interaction between the surface of the
   surface
view and the main view hierarchy limited.

The purpose of SurfaceView is to present static things like video
   playback
or a game playfield in its own surface so that it can draw outside of 
the
normal view hierarchy update model (and use OpenGL drawing, different
   color
spaces, etc).  It is not to give a tight integration with the rest of 
the
view hierarchy.

You should essentially think of it as an overlay, because really that is
what it is.

On Mon, Sep 19, 2011 at 10:29 AM, MobileVisuals 
   eyv...@astralvisuals.comwrote:

 My app uses a ViewFlipper. It is possible to flip between the views
 without problems at first.But after switching to another app and then
 switching back to the ViewFlipper app, it is not possible to flip
 between the views. One of the views is always displayed as just a
 black screen.

 I have investigated the reason for this, using the simplest possible
 SurfaceView. It is still the same problem.
 It is not a thread problem, I see that the onDraw method is called
 like it should. What is the reason for this? Doesn't the ViewFlipper
 class support SurfaceView like it should?

  I got the code for the SurfaceView from the basic tuturial:

http://www.edu4java.com/androidgame/androidgame2.html

 and the code for the View flipper from Mark Murphys View flipper
 tutorial:

https://github.com/commonsguy/cw-android/tree/master/Fancy/Flipper1

 This is my code:
 -

 public class FlipperDemo2 extends Activity {

 ViewFlipper flipper;

 @Override
 public void onCreate(Bundle icicle) {
 super.onCreate(icicle);
 setContentView(R.layout.main);

 flipper=(ViewFlipper)findViewById(R.id.details);
 GameView lv=new GameView(this.getApplicationContext(),true);
 flipper.addView(lv,
                new ViewGroup.LayoutParams(
                ViewGroup.LayoutParams.FILL_PARENT,
                ViewGroup.LayoutParams.FILL_PARENT));
 GameView lv2=new GameView(this.getApplicationContext(),false);
 flipper.addView(lv2,
                new ViewGroup.LayoutParams(
                ViewGroup.LayoutParams.FILL_PARENT,
                ViewGroup.LayoutParams.FILL_PARENT));
 flipper.setFlipInterval(2000);//2000
 flipper.startFlipping();
 }
 }
 --

 public class GameView extends SurfaceView {

        private SurfaceHolder holder;
    boolean blue;

    public GameView(Context context,boolean _blue) {

          super(context);
          holder = getHolder();
          blue=_blue;
          holder.addCallback(new SurfaceHolder.Callback() {

                 @Override
                 public void surfaceDestroyed(SurfaceHolder holder) {

                 }

                 @Override
                 public void surfaceCreated(SurfaceHolder holder) {

                        Canvas c = holder.lockCanvas(null);
                        onDraw(c);
                        holder.unlockCanvasAndPost(c);

                 }

                 @Override
                 public void 

[android-developers] Re: Send message with C2DM to selected devices

2011-09-20 Thread Jens
Each device has its own registration ID so you can push messages to a
specific device.

On Sep 19, 9:24 am, Joshua Partogi joshua.part...@gmail.com wrote:
 hi there,

 I am interested to use C2DM for my application. Is it possible to send push
 messages to selected devices only? Or will it send to all devices that has
 my application?

 Thank you in advance for your help.

 --
 @jpartogi

-- 
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: Have problem with compare arraylists in Android

2011-09-16 Thread Jens
You typically do not do String comparison using ==, try using the
equals(..) method instead - in your case directly on your ArrayLists.

if (user.equals(mine)) {
  // Start a new activity.
}

Btw, you should consider using generics for your lists, e.g.

ArrayListString mine = new ArrayListString();

On Sep 16, 4:27 pm, Zwiebel hunzwie...@gmail.com wrote:
 I need to have two arraylists. I declared them. I declared a mine
 arraylist and an user arraylist with this code:

       ArrayList mine = new ArrayList();
         ArrayList user = new ArrayList();

 I want to store in these values, what are will be important to contact
 with the user:
 I added values to my mine arraylist:
         mine.add(0);
             mine.add(1);
             mine.add(0);

 I want to add a values to the user named arraylist if the user press a
 button. So I added this code:
     user.add(0);

 and

     user.add(1);

 to an another button.

 I added two

     Log.i(user, user.toString());

 line to the buttons so I can follow how the arraylist looks like in
 the appropriate moments.

 Then if the user clicks an another button, I want to compare these
 lists, so I implemented the following code:

         for (int j = 0; j  user.size(); j++) {
                             for (int k = 0; k  mine.size(); k++) {
                                 if (user.get(j) == mine.get(k)) {
                                     //start a new activity
                                 }

 If the two arraylists are the same in the order and in values, I want
 to show a new screen (its name is for example good), and if not I want
 to show an another( its name is for example lose). But I have a
 problem. My program is only show my lose screen if the user only
 clicked the button which add 1 to the arraylists, or if he/she only
 clicked the button which add 0 to the arraylist. How can I make my
 program to run as I want? Thanks in advance

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@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 to get an interval of bytes from a file?

2011-09-16 Thread Jens
Try java.io.RandomAccessFile.

Call RandomAccessFile#seek() to position the file pointer correctly
and then call one or more of the read(..) methods available in the
RandomAccessFile class. Or you could go balls deep and use a
FileChannel, but that is about as fun as pleasuring yourself with a
cheese-grater.

Oh, and RandomAccessFile#close it afterwards whydoncha.

On Sep 16, 4:04 pm, Lidia lidyp...@yahoo.com wrote:
 Hello, please help me,

 I have to upload different media files, some of them a big, and i have
 the possibility to upload a file in few pieces of encoded string of
 bytes.

 I need to read a particular interval of bytes from a file.
 I can't create an array of bytes from the whole file, because the
 application crashes, heap memory is too low, OutOfMemoryError happens.

 As i see the following is not what i need:

 byte[] output = new byte[(int) bytesToRead];
 InputStream is = new FileInputStream(file);
 is.read(output, offset, bytesToRead);

 Thanks in advance
 Lidia

-- 
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 is RockPlayer doing hardware decoding?

2011-09-16 Thread Jens
Or, crack open their app and check the build of the ffmpeg library.

If they forgot to do the mandatory sanity checks on their build
(i.e. forgot to read http://ffmpeg.org/legal.html that has useful
build instructions) you could always request a copy of the now GPL-
licensed source code to their entire application or file a takedown of
their app.

On Sep 10, 10:37 am, gjs garyjamessi...@gmail.com wrote:
 Hi,

 You should ask 'RockPlayer'

 Regards

 On Sep 9, 6:30 pm, B.Arunkumar awsnetworkrecor...@gmail.com wrote:

  Hi,

      Would somebody have some idea what exactly has RockPlayer done in
  the Hardware Decoding mode on a high level basis? I mean have they
  used the mediaplayer as it is or they have changed something at the
  source code level of MediaPlayer to get more improvements than the
  MediaPlayer (support more RTSP Url formats) and things like that?

  Thank you,
  B.Arunkumar

  On Sep 4, 6:42 am, Felix long felixl...@gmail.com wrote:

   Yes, You're right. The hardware decoding mode only means using inbuilt
   MediaPlayer in these players.

   2011/9/3 B.Arunkumar awsnetworkrecor...@gmail.com

Thank you for your reply. The RockPlayer gives you the option of
choosing either the Hardware or Software Decoding mode. The Software
Decoding mode I am pretty sure does what you are saying, uses the
FFMPEG package to decode the frames. Does the hardware decoding mode
of RockPlayer also use FFMPEG? The question I have is the inbuilt
MediaPlayer and VideoView classes of Android use the inbuilt hardware
decoder of the device. Is the Hardware Decoding mode of RockPlayer
doing something similar?

A thought process along the same lines is if it possible to use the
hardware decoder of the device programmatically through some means?

Thank you,
B.Arunkumar

On Sep 2, 8:33 pm, Drezden mmjohns...@gmail.com wrote:
 I believe they're using a customized build of FFMpeg that gets
 accessed through the NDK.  FFMpeg has the ability to do a lot of
 manipulation with video, audio, and images.

 On Sep 2, 9:15 am, B.Arunkumar awsnetworkrecor...@gmail.com wrote:

  Hi,

       Would somebody be able to guide me on howRockPlayer/MoboPlayer
  does the hardware decoding of image frames?

  Thank you,
  B.Arunkumar

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

   --
   Best Regards

   Felix Long

-- 
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: Hide Phone Number in the Dialer

2011-09-11 Thread Jens
Have you tried supplying your own account manager implementation,
adding a contact with the display name My Special Number and then
sending your dialer Intent?

Since you cannot override (afaik) the dialer from appspace that'd
pretty much be the only way of doing it.

On 11 Sep, 01:44, mwllace wallace.d.m...@gmail.com wrote:
 Im using  and intent to invoke the default dialer and automatically
 call  phone number stored in my application. Everything works fine,
 but the number is visible in the default dialer UI. I need to display
 something else in place of the number like My Special Number. The
 behavior would be much like when a user dials a number already stored
 in contacts, where the name of the person is visible and not the
 underying phone number.

 I am able to update the call logs so they read My Special Number
 when my app dials this number, but this is only after the phone is
 hung up.

 This is the way I update the Call Log:

 values.put(CallLog.Calls.CACHED_NAME, My Special Number);

 Is there a similar method for writing to the default dialer when the
 call is initiated?

 Thanks for any pointers you can provide!

-- 
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: can Wi-Fi and 3G establish network connections individually and simutaneously on a single android?

2011-07-21 Thread Jens
Yes.

Using

http://developer.android.com/reference/android/net/ConnectivityManager.html#TYPE_MOBILE_HIPRI

you should be able to do short, explicitly routed transmissions on the
mobile network while maintaining a WiFi connection. There's a timeout
on the TYPE_MOBILE_HIPRI request and you may need to refresh it every
minute or so to maintain the connection.


On 14 Juli, 06:33, Ryan ryanhsu1...@gmail.com wrote:
 Hi ,
 can Wi-Fi and 3G establish network connections individually and
 simutaneously on a single android?
 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: CursorAdapter over multiple columns

2011-07-04 Thread Jens
Yeah, you should just do a join between table A and table B that
includes the required column from B and use that in your cursor
adapter.

A simple google search for sqlite join would give you a clear how-to.

On 29 Juni, 07:39, jjoe64 g.jjo...@googlemail.com wrote:
  i don't understand your problem.
 did you joined your two tables?

-- 
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: Initial setup after app install/update?

2011-06-16 Thread Jens
If your app includes a broadcast listener for one of the more spammy
intents you can create a somewhat delayed setup this way.
Plz remember to disable the listener afterwards using
PackageManager#setComponentEnabledSetting(..)

On 15 Juni, 16:29, Joshua Partogi joshua.part...@gmail.com wrote:
 Hi all,

 Is it possible to implement an initial setup after the app has been installed?

 Kind regards,
 Joshua

 --
 @jpartogi

-- 
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 to add APP icon to desktop automatically

2011-06-15 Thread Jens
You cannot obtain the required permissions unless your application is
installed as a system package.


On 14 Juni, 09:41, June_Hello junehelloworld.he...@gmail.com wrote:
 Hi folks,
 I find that when  switch on the mobile, some icon of the application
 (for example. Mms , Phone, Contacts) has been added on desktop by
 default, so my question is if I write a new  application, how can I
 add the icon to desktop like that (I do development on source code ,so
 need to install xxx.apk, just make it and release it with system
 image)
 thanks for any help

-- 
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 to add APP icon to desktop automatically

2011-06-15 Thread Jens
If you're building the system image and are using Launcher2 as your
homescreen (or a version thereof) you could just add it to the
default_workspace.xml

http://android.git.kernel.org/?p=platform/packages/apps/Launcher2.git;a=blob;f=res/xml/default_workspace.xml;h=30c542a4f9dabf0160ff700f53bcba3348009902;hb=refs/heads/master

The default_workspace.xml file is read in
LauncherProvider#loadFavorites(SQLiteDatabase db) (same git), which
will show you how they do it.

On 15 Juni, 10:00, June Hello junehelloworld.he...@gmail.com wrote:
 Sorry for my mistake, I put my app in source code and make it into the
 system.img, so there is no need to install it. I think it is a system
 package, is it right?







 On Wed, Jun 15, 2011 at 3:30 PM, Jens dunkingbikk...@gmail.com wrote:
  You cannot obtain the required permissions unless your application is
  installed as a system package.

  On 14 Juni, 09:41, June_Hello junehelloworld.he...@gmail.com wrote:
   Hi folks,
   I find that when  switch on the mobile, some icon of the application
   (for example. Mms , Phone, Contacts) has been added on desktop by
   default, so my question is if I write a new  application, how can I
   add the icon to desktop like that (I do development on source code ,so
   need to install xxx.apk, just make it and release it with system
   image)
   thanks for any help

  --
  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: opening a url in browser with post data from an activity

2011-06-14 Thread Jens
WebView webView = ;
ListNameValuePair parameters = new ArrayListNameValuePair();
parameters.add(new BasicNameValuePair(parameter1, someValue));
parameters.add(new BasicNameValuePair(id, 12345));
parameters.add(new BasicNameValuePair(encodingTest, \;));
UrlEncodedFormEntity entity = new UrlEncodedFormEntity(parameters);
webView.postUrl(http://some.host.com/path;,
EntityUtils.toByteArray(entity));

If you need a specific encoding on your posted data you supply that in
the alternative ctor of UrlEncodedFormEntity.

On 13 Juni, 13:41, Shashidhar shashi.zep...@gmail.com wrote:
 Hi,
  I need to open a browser with a URL when I click on a button in my
 activity.
 The URL has some parameters which I need to send it using HTTP POST method.
 I am able to get it working with the GET request where we append the
 parameters to the end of the URL.
 But, I need the POST method way.
 Any Ideas on how to send the URL data using POST method to open it in
 browser.

 Thanks,
 Shashidhar

-- 
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 to get manifest values?

2011-06-10 Thread Jens
AFAIK the GET_INTENT_FILTERS flag in PackageManager has never been
implemented (even though it's been declared since version 1 of the
API).

If it's your own manifest file you want to access Dougs advice is spot
on - if you want to inspect the intent-filters of other applications
your SOL.

On 9 Juni, 14:05, Ashok Jeevan ashokjee...@gmail.com wrote:
 Hi

 I need to get MIME type values from the manifest file in an Activity class.

 Is there any way to access values from the manifest?

 Ashok Jeevan
 +91 9895401278

-- 
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: Encoding image into Base64

2011-06-10 Thread Jens
That depends wholly on your backend - although a backend that requires
you to use Base64 encoding seems a tad bit pointless.

Are you sure you're not supposed to post the image directly (using a
FileEntity or InputStreamEntity for instance) - with the correct
Content-Type set of course?

On 9 Juni, 12:12, perumal316 perumal...@gmail.com wrote:
 Hi All,

 I need to do a HTTPPost of a Jpeg and a Jpeg2000 image to a backend.
 For Jpeg I converted it to byte array and did a Base64 encoding using
 the Base64 class which is available in Android.

 See:http://developer.android.com/reference/android/util/Base64.html

 Is this the correct way to do? Because I am not receiving any image in
 the backend.

 This is for jpeg. Is I do the same steps using Jpeg2000 my application
 crashed.

 How do I do a HTTPPost of a Jpeg2000 image? Is encoding of image to
 Base64 a must? Is there any other way?

 Thanks In Advance,
 Perumal

-- 
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 MD5 Hash doesn't match Hash generated from .NET application

2011-06-07 Thread Jens
EncodingUtils#getString(byte[], String) is for byte array to String
conversions, given a *character set* - not a *transfer encoding* (such
as Base64).

You want to use android.util.Base64 (available since 2.2).

On 6 Juni, 13:13, Mark Murphy mmur...@commonsware.com wrote:
 You are not generating Base64 output from the Android code, as is
 blindingly obvious by looking at your output and seeing that it is not
 Base64-encoded. I have no idea if EncodingUtils is supposed to support
 Base64 -- that's not documented.

 On Fri, Jun 3, 2011 at 3:10 PM, aa...@radich.com









 kiley_rad...@hotmail.com wrote:
  I'm using the following Android code to generate a HmacMD5 hash.  When
  I generate the hash from the Android App I get the following:
  J0t j#߸ bq- .  When I generate the hash from a .net console
  application I get: SjB0j+xqI9+4hxticS0Cjw==.  Notice the difference
  and that the Android has has special chars in it.  Is this a character
  set issue?

  Aaron

  ==
  Here's the Android code:

  public class HMACMD5 {

    private final String HMAC_MD5_NAME = HmacMD5;

    private SecretKeySpec sk;
    private Mac mac;

    public HMACMD5(byte[] key) throws GeneralSecurityException {
       init(key);
    }

    public HMACMD5(String key) throws GeneralSecurityException {
       init(EncodingUtils.getAsciiBytes(key));
    }

    private void init(byte[] key) throws GeneralSecurityException {
       sk = new SecretKeySpec(key, HMAC_MD5_NAME);
       mac = Mac.getInstance(HMAC_MD5_NAME);
       mac.init(sk);
    }

    public byte[] ComputeHash(byte[] data) {
       return mac.doFinal(data);
    }

    public byte[] ComputeHash(String data) {
       return ComputeHash(EncodingUtils.getAsciiBytes(data));
    }
  }

  public String encodeText(String sKey, String sSrc) throws Exception {
       HMACMD5 hmacMD5 = new HMACMD5(sKey);
       byte[] textBytes = EncodingUtils.getBytes(sSrc, UTF-8);
       byte[] encodedTextBytes = hmacMD5.ComputeHash(textBytes);
       String sEncodedText = EncodingUtils.getString(encodedTextBytes,
  BASE64);
       return sEncodedText;
  }

  ==
  Here's the .NET code:

  public static string EncodeText(byte[] key, string sText, Encoding
  encoding)
  {
    HMACMD5 hmacMD5 = new HMACMD5(key);
    byte[] textBytes = encoding.GetBytes(sText);
    byte[] encodedTextBytes = hmacMD5.ComputeHash(textBytes);
    string sEncodedText = Convert.ToBase64String(encodedTextBytes);
    return sEncodedText;
  }

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

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy

 _The Busy Coder's Guide to *Advanced* Android Development_ Version
 1.9.3 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
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: How to read data from ./asset/ files correctly?

2011-05-31 Thread Jens
i think this is incorrect and slow.

Hell yes. Do you need the entire asset in-memory? Then you should
either consider reading it into a ByteArrayOutputStream or
allocate the required bytes as an array after determining the size of
the asset.

I do not know how to get datasize from inputstream and i read data two
time :-)

Use the android.content.res.AssetFileDescriptor  call #getLength() /
#getDeclaredLength()?

Works like a charm. Remember to call #close() on the
AssetFileDescriptor.

-- 
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: Connecting to https server from java

2011-05-23 Thread Jens
It's also quite possible the certificate chain is a bit iffy.

You can check this quite easily by surfing to the URL with the *built-
in browser* in your Android phone. If the certificate works there but
*not* in your app (i assume you are using the Apache HttpClient?) its
most often your chain that is ordered incorrectly.

The built-in browser had a fix (afaik) for badly ordered certificates,
HttpClient does not.


If you are using a self-signed certificate or a root certificate not
in the phone you'll have to do it the hard way and add your own
truststore (AuthSSLProtocolSocketFactory for instance). Uh, and
Android only support BKS for the keystore I think.

On 23 Maj, 04:23, DanH danhi...@ieee.org wrote:
 Assuming the server is legitimate, you basically see this problem
 because the certificate presented by the HTTPS server doesn't have a
 certificate chain that can be verified against one of the root
 certificates on the phone.  It may be possible to download and install
 a new (additional) root authority certificate on the phone (I don't
 know if this is possible on Android -- it isn't on some phones).  If
 not, or if you want a fix that doesn't require actions on the part
 of the user, you can either tell the HTTPS protocol to not verify the
 server's cert (not particularly dangerous if the trusted URL is
 hardwired into your app), or you can include a suitable root cert in
 your application and give that to the HTTPS protocol for its use.
 (I'm not familiar with how precisely you do these things on Android.)

 On May 22, 6:58 pm, dashman erjdri...@gmail.com wrote:

  I'm trying to connect to a server via https and am getting
  invalid server certificate.

  how do i solve this.



-- 
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: regarding HTTPClient : How to get the HTTP request posted by the native browser

2011-05-20 Thread Jens
Apache - as in the HttpClient, org.apache.http.* or the web server?
Further - the browser in the phone typically doesn't use the apache
HTTP client library, it's JNI to WebKit.

The good thing is that you're not going to be able to sniff either
without building your own firmware and flashing the phone.

On 19 Maj, 13:41, Viju mail2vija...@gmail.com wrote:
 Hi,

 Is it possible to get all the HTTP URL request triggered by the
 browser (Apache) from my client application ? If then, can you please
 tell me the framework API which gives me the URL ?

 I'm developing some kinda of HTTP sniffer application for android
 which will log all the HTTP Url request made by the native browser
 (Apace) and store it in a local file.

-- 
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 to get synced Google contact group programmatically ?

2011-05-19 Thread Jens
I assume you mean :

http://developer.android.com/reference/android/provider/ContactsContract.Groups.html
http://developer.android.com/reference/android/provider/ContactsContract.CommonDataKinds.GroupMembership.html

Groups  group membership information is in the same ContentProvider
that stores the actual contacts synced with Google.

On 19 Maj, 08:55, Goutom goutom.sust@gmail.com wrote:
 Hi All

 We know android phone can sync google contact group dynamically if we add
 account.Now I want to get the file where the groups information  are saved.I
 need code to get groups information and need to show in my activity.

 Can any one help ?

 Cheers
 Goutom
 WebRep
 Overall rating

-- 
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 to enable and disable OpenGL2.0 in andorid

2011-05-18 Thread Jens
1. You need a real device. OpenGL ES 2.0 is not something you can play
with on the emulator.
2. Go here:

http://code.google.com/p/gdc2011-android-opengl/wiki/TalkTranscript
https://code.google.com/p/gdc2011-android-opengl/source/browse/trunk/


On 17 Maj, 07:52, Jetti jettima...@gmail.com wrote:
 Hi,

 I want to learn OpenGL2.0 in android.But I didn't find the way how to
 enable and disable OpenGL2.0 in andorid and Android Browser. If anyone
 knows please help me on this..

 Thanx in advance..

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@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: good 2d physics engine

2011-05-12 Thread Jens
JBox2D is decent enough. If you're writing a game using the NDK you
should probably use the normal Box2D, it compiles readily on Android.

On 11 Maj, 20:28, bob b...@coolgroups.com wrote:
 Can anyone recommend a good 2d physics engine for Android?

-- 
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: Building C code for Android (no Java/jni)

2011-05-03 Thread Jens
Yeah, using NativeActivity (2.3+) from the NDK you can sometimes get
away without writing any java code at all.

On 3 Maj, 18:28, Justin Anderson magouyaw...@gmail.com wrote:
 Without using the NDK it is not possible...

 Thanks,
 Justin Anderson
 MagouyaWare Developerhttp://sites.google.com/site/magouyaware

 On Tue, May 3, 2011 at 3:47 AM, Mark maf...@yahoo.co.uk wrote:
  Hi,
  Can anyone tell me how to compile+build a program, written in C on
  Android?  There's no Java code and I don't want a shared lib to use
  with JNI.  The NDK does not seem to help 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 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: Force Close on Click in Calendar after i delete all information set in it

2011-05-02 Thread Jens
It's especially problematic if you're trying to work with closed
source, such as Android 3.0 - you should consider setting
maxSdkVersion to prevent people from seeing your app on 3.0.

On 2 Maj, 15:34, Dianne Hackborn hack...@android.com wrote:
 You can expect individual devices to behave differently when you are using
 private APIs like these, regardless of platform version.  Writing code like
 this is going to be a continual source of trouble for you.



 On Mon, May 2, 2011 at 4:36 AM, Alok Kulkarni kulsu...@gmail.com wrote:
  Hi All,
   I am trying to remove all Calendar related entries from a phone(Galaxy
  tab)
  Here is the code

  /**
          * Deletes all calendar info
          */
         private boolean _deleteCalendarInfo() {
                 try {

                         String uriPrefix;
                         if (Build.VERSION.SDK_INT =
  Build.VERSION_CODES.ECLAIR_MR1) {
                                 uriPrefix = content://calendar/;
                         } else {
                                 uriPrefix =
  content://com.android.calendar/;
                         }

                         int cnt = contentResolver.delete(Uri.parse(uriPrefix
  + events),
  null, null);
                         Log.i(Data Wipe,Calendar events deleted Count
  +cnt);
                         contentResolver.delete(Uri.parse(uriPrefix +
  calendars), null,
                                         null);
                         Log.i(Data Wipe,Calendars events deleted Count
  +cnt);
                 } catch (Exception e) {
                         // TODO Auto-generated catch block
                         e.printStackTrace();
                         Log.i(Data Wipe,Calendar delete
  failed+e.toString());
                         return false;
                 }
                 return true;
         }

  The code executes successfully, but after that when i go into calendar
  manually and try to add an event, it is giving force close with
  following error
  android.database.CursorIndexOutOfBoundsException: Index 0 requested,
  with a size of 0

  Detailed stack trace:-

  05-02 14:02:08.077: ERROR/AndroidRuntime(3412): Caused by:
  android.database.CursorIndexOutOfBoundsException: Index 0 requested,
  with a size of 0
  05-02 14:02:08.077: ERROR/AndroidRuntime(3412):     at
  android.database.AbstractCursor.checkPosition(AbstractCursor.java:580)
  05-02 14:02:08.077: ERROR/AndroidRuntime(3412):     at

  android.database.AbstractWindowedCursor.checkPosition(AbstractWindowedCursor.java:214)
  05-02 14:02:08.077: ERROR/AndroidRuntime(3412):     at

  android.database.AbstractWindowedCursor.getInt(AbstractWindowedCursor.java:84)
  05-02 14:02:08.077: ERROR/AndroidRuntime(3412):     at
  android.database.CursorWrapper.getInt(CursorWrapper.java:123)
  05-02 14:02:08.077: ERROR/AndroidRuntime(3412):     at
  com.android.calendar.EditEvent.setCalendarData(EditEvent.java:4098)
  05-02 14:02:08.077: ERROR/AndroidRuntime(3412):     at
  com.android.calendar.EditEvent.onCreate(EditEvent.java:2333)
  05-02 14:02:08.077: ERROR/AndroidRuntime(3412):     at
  android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
  05-02 14:02:08.077: ERROR/AndroidRuntime(3412):     at
  android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
  05-02 14:02:08.077: ERROR/AndroidRuntime(3412):     ... 11 more

  I have probably found  what the problem is on Stack Overflow.It states
  Query is returning 0 rows, which is why you are getting an error
  attempting to use the 1st row of a 0-row Cursor

  Is there any better way to Delete all calendar info ?
  Thanks,
  Alok

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

 --
 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: How do you counter repeated bogus reviews from competitors?

2011-04-25 Thread Jens
  I am wondering how do you deal with this? What steps do you take to
 prevent such abuse of Android Market?

Payback - it can be a bitch.

Step 1. Download app from offending party.
Step 2. Decompile app from offending party.
Step 3. Fill it to the brim with malware.
Step 4. That's not enough! Try to cram in more malware!
Step 5. Repeat 3-4 until you get bored.
Step 6. Build and put it up on warez-sites.

Or you could just maintain the moral high ground - hopefully the
market team will get around to fixing the entire Market experience
some time soon.

-- 
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: SAXParser throws exception for bad character in CDATA block, bug???

2011-04-22 Thread Jens
Unfortunately it appears he's parsing a vBulletin RSS feed, i.e. its
most likely something he has little or no control over - and if the
host he is scraping ever upgrades to a version that fixes this odd
behavior (i.e. mixing character encodings) his app should not break if
he supplies a Reader to the emergency fix that actually uses the
character set declared by the server.

Fortunately it appears he's parsing a vBulleting RSS feed - i.e.
transient events that hopefully aren't super important in anything but
the near scope.

On 22 Apr, 02:46, Bob Kerns r...@acm.org wrote:
 Oh, one other model that may help put all this in context -- and make it
 plain that there really is no other way for it to be.

 The confusion here stems from confusing bytes and characters. XML works with
 characters.

 The encoding (UTF-8, ISO-8859-1) of an XML document refers to how a stream
 of characters is encoded into a stream of bytes -- and, on input, bytes into
 characters.

 XML is then defined in terms of a series of characters.

 CDATA then says how those characters are treated.

 The failure here, happens at the level of interpreting the bytes. The bytes
 that your byte stream is presenting, cannot be converted into ISO-8859-1
 characters.

 FAIL. It hasn't even gotten to the XML parser. Depending on the buffering
 going on, in fact, the XML parser may not yet even have seen the start of
 the CDATA section.

 The failure here is simply that a supposed ISO-8859-1 stream -- is not. It
 really has nothing to do with CDATA or XML at all.

 Jens' approach operates at this level -- it turns a byte stream that is not
 a valid ISO-8859-1-encoded byte stream, into one that at least *appears* to
 be an ISO-8859-1-encoded byte stream.

 If it happens to be a UTF-8 byte stream (ISO-10646 encoded via UTF-8), it
 will be gibberish -- even many valid ISO-8859-1 characters will become
 gibberish bytes mis-interpreted, rather than the ISO-8859-1 characters they
 started out life as.

 That's why I don't like Jens' solution. (I doubt Jens likes it either --
 this is a hold your nose sort of situation). It really has the potential
 to make things much worse.

 I hope that makes it a bit more clear.

-- 
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: I am developing android application and I have to take my photo using browse button.

2011-04-22 Thread Jens
If you're looking for a way to use the gallery applications image
picker in your form to allow the user to select an image you should
refer to
ACTION_PICK in the Intent class. Or, lmgtfy:

http://stackoverflow.com/questions/550905/access-pictures-from-pictures-app-in-my-android-app

This will start the image pic
On 21 Apr, 07:36, rekha yadav ydre...@gmail.com wrote:
 I am devloping android application. I have created a form. On the form
 I have to browse my stored images in the mobile.

 Please help me how to do the same task. I am new to android
 development.

-- 
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: SAXParser throws exception for bad character in CDATA block, bug???

2011-04-21 Thread Jens
No its a bug in your feed.

CDATA is not parsed in the sense that characters that otherwise
would be recognized as mark-up are ignored - it's not a carte blanche
to add binary junk/illegal characters to XML.

Try passing something like this instead (wrapped in an InputSource) to
the SAXParser#parse method.

class StripReader extends Reader {
private final Reader mReader;
public StripReader(Reader reader) {
mReader = reader;
}
@Override
public boolean markSupported() {
return false;
}
@Override
public void close() throws IOException {
mReader.close();
}
@Override
public int read(char[] cbuf, int off, int len) throws 
IOException {
int n = 0;
int ch = 0;
for (int i = 0; i  len; i++) {
ch = read();
if (ch != -1) {
cbuf[off + n++] = (char) ch;
}
}
return (n == 0  ch == -1) ? -1 : n;
}
@Override
public int read() throws IOException {
int ch;
do {
ch = mReader.read();
} while (ch != -1  !validChar(ch));
return ch;
}

private boolean validChar(int ch) {
// Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | 
[#xE000-#xFFFD] |
[#x1-#x10]
/*  any Unicode character, excluding the surrogate blocks, FFFE, and
. */
return ch == 0x9 || ch == 0xA || ch == 0xD || (ch = 
0x20  ch =
0xD7FF) || (ch=0x1  ch =0x10);
}
}

On 15 Apr, 22:54, Phil Bayfield p...@bayfmail.com wrote:
 I'm having an issue with SAXParser on an RSS feed from a vBuletin forum.

 The parser throws SAXException - At line 212, column 26: not well-formed
 (invalid token) when it encounters a right apostrophe character 
 -http://www.fileformat.info/info/unicode/char/2019/index.htm

 I realise this is a unicode character and the feed is ISO-8859-1, however
 the character falls in a CDATA block, which the parser is supposed to
 ignore.

 Anyone encountered this before and know a work around? I've tried things
 like forcing UTF-8 with no luck.

 Is this a bug that the parser is not ignoring data in the CDATA block?

-- 
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 to produce a closed source library ?

2011-04-21 Thread Jens
I'm guessing he wants to build a .jar file and distribute it to
customers.

It can be done relatively easily as long as you *do not have any
dependencies into the res/ folder* in your jar - a custom ant script
that runs aidl (if necessary), compiles the code (including your
android.jar in the class-path), runs obfuscation and finally executes
a jar ant-task to build the JAR-library.


On 20 Apr, 18:59, TreKing treking...@gmail.com wrote:
 On Fri, Apr 15, 2011 at 3:46 AM, Fougère v.dec...@gmail.com wrote:
  I would like to keep the source closed (it is a professional project with
  no open-source allowed). Is there a way to do it ?

 You may want to elaborate your question. I assume don't publish the source
 is not the answer you're looking for.

 -
 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


[android-developers] Re: which is the best way to play encrpted song instantly?

2011-04-21 Thread Jens
What is the output of your decrypted stream? If it is PCM you can dump
it directly in an AudioTrack and play it that way.

If its something else, i.e. MP3, you can include a decoder for your
format and decode to PCM yourself and still use AudioTrack.



On 20 Apr, 06:01, Hitendrasinh Gohil hitendra.virtuei...@gmail.com
wrote:
 hi,
 play while you decrypthow i can do it?

 --
 Regards,
 Hitendrasinh Gohil

-- 
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: Intercepting HTTP Requests in Android

2011-04-21 Thread Jens
Not using the SDK (thankfully). In a custom platform build, sure.

On 21 Apr, 12:32, gauri gauri.v...@gmail.com wrote:
 Hello,
          I want to intercept outgoing HTTP requests. Are there any
 intents in Android which are broadcasted when such requests are sent?
 Or are there any methods in java which can be used to listen to ports
 through which requests are sent out .

 Thanks in advance.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@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: This is True / False or a bug!?

2011-04-21 Thread Jens
You could start with your broken string comparison.

(xx==Local1);

Use String#equals(String) instead if you're not trying to ascertain if
xx and Local1 are both *instances* of the same String object.

On 20 Apr, 06:08, Perry168 perry...@netvigator.com wrote:
 Hi,
 Today, I wrote a program. The function is to get the installed
 packages name through the provider name. But I find a problem, when I
 compare two SAME strings. The Boolean result will be FALSE.
 I used the Eclipse to watch the value change. From expression, I saw
 the Local1 and xx are same. But the Boolean bb is false. Also I
 installed the apk to phone too. I found the result is FALSE too.
 I don’t know the problem come from and how to fix it.
 I hope who can teach me.
 Following is my main.XML and source.

   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
     
     TextView android:text=TextView android:id=@+id/tV1
 android:layout_width=wrap_content
 android:layout_height=wrap_content/TextView
     Button android:text=Button android:id=@+id/bn1
 android:layout_width=wrap_content
 android:layout_height=wrap_content/Button
 /LinearLayout

  JAVA SOURCE 
 import java.util.List;
 import android.app.Activity;
 import android.content.pm.PackageInfo;
 import android.content.pm.ProviderInfo;
 import android.os.Bundle;
 import android.view.View;
 import android.view.View.OnClickListener;
 import android.widget.Button;
 import android.widget.TextView;

 public class FindPackage extends Activity  implements OnClickListener
 {

     TextView tV1;
     Button bn1;
         String xx = com.android.alarmclock;
         Boolean bb = false;

     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.main);

     tV1 = (TextView) findViewById (R.id.tV1);
     bn1 = (Button) findViewById (R.id.bn1);
     bn1.setOnClickListener (this);
     }

         @Override
         public void onClick(View v) {

         if (v == bn1){
                 List PackageInfo  aa = null;
                 ProviderInfo [] kk = null;
                 String Local1 = ;
                 aa =  this.getPackageManager().getInstalledPackages(8); // 
 Get all
 Packages
                 int i = aa.toArray().length-1; // Get Number of Packages

         while (i=0)
         {
                 kk = aa.get(i).providers; // Withdraw the Provider
                 if (kk == null){
                         i--;
                         continue;
                 }
                 if (kk[0].name.contains(Alarm)) // Checking the Provider 
 name
 which has Alarm word
                                 {
                                 Local1 = kk[0].packageName; // put the 
 package name into
 Local1
                                 break;
                                 }
                 i--;
         }

                 i = 0;

             bb = (xx==Local1);

             tV1.setText(bb+); // Show the result

         }

         }

 }



-- 
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 to force use only gprs even though wifi is available

2011-04-15 Thread Jens
It is.

http://developer.android.com/reference/android/net/ConnectivityManager.html#TYPE_MOBILE_HIPRI


On 15 Apr, 07:18, kiran saikiran@gmail.com wrote:
 Yes you are right, But thing is my application itself making wifi on.
 Is it not possible to on wifi and gprs at a time?

 On Apr 14, 2:34 pm, Kostya Vasilyev kmans...@gmail.com wrote:

  You can disable WiFi by calling WifiManager.setWifiEnabled(false).

  Just don't forget to tell the user you're doing this.

  -- Kostya

  14.04.2011 13:18, saikiran n пишет:

   Hi,

   I am using internet in some application. If any wifi configuration is
   available while my application is running it is switching to wifi
   instead gprs.
   How can stop switching. My requirement is i have to use only gprs.
   Thanks in advance

  --
  Kostya Vasilyev --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: Reusable HttpResponse in android network programming?

2011-04-12 Thread Jens
You can wrap the HttpEntity in a BufferedHttpEntity and reuse that.


DefaultHttpClient client = new DefaultHttpClient();
HttpGet get = new HttpGet(http://www.somearbitraryurl.com;);
HttpResponse response = client.execute(get);
HttpEntity reusableEntity = new
BufferedHttpEntity(response.getEntity());

If you need to have it wrapped in a HttpResponse you can always try
and create an instance of BasicHttpResponse like so:

BasicHttpResponse reusableResponse = new
BasicHttpResponse(response.getStatusLine());
reusableResponse.setHeaders(response.getAllHeaders());
reusableResponse.setEntity(reusableEntity);

On 11 Apr, 11:35, mathcat scien...@gmail.com wrote:
 Hi geeks!

 As using the network package which apache provides, we usually do :
 HttpResponse resp = httpClient.execute(httpRequest);

 When I retrieve the HttpEntity object of the response, open the
 InputStream and extract the data in it, the HttpResponse object
 becomes unusable. If I try to do the thing again, exception occurs.

 Here I wish to reuse the HttpResponse, mostly for caching. But the
 HttpResponse object returned is type interface, I cannot call clone.

 Is there any way I can reuse the HttpResponse ?

-- 
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: Using Google Calendar API

2011-04-11 Thread Jens
Are you running this on an emulator? They typically do not contain the
calendar or calendar provider applications.

You can build (from the platform sources) and install your own
calendar provider APK on the emulator though.


On 10 Apr, 21:08, New Developer secur...@isscp.com wrote:
 anyone solved the use of Google Calendar API ?

 tried the method  from  http://jimblackler.net/blog/?p=151
 content://calendar/calendars   and    
 content://com.android.calendar/calendars

 I get the ERROR
 Failed to find provider info for com.android.calendar

 when I try the  google gdata  api's

 I have the jar files connected via  external libraries
 but this generates, compiles and shows no errors but executes with this 
 runtime ERROR

 Could not find class 'com.google.gdata.client.calendar.CalendarService',

 Thanks in advance

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@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: Using Google Calendar API

2011-04-11 Thread Jens
If you cannot find precompiled APKs of the calendar and calendar
provider (i.e. lift them from an actual Android device) you can build
the platform yourself:

http://source.android.com/source/initializing.html

and build your own SDK - it should contain the APKs you're looking
for. Optionally, you can copy the APKs from the build and install them
on the emulator you're already running.

Most devices should contain at least the provider but you should take
proper care and consider that you are effectively trying to integrate
with a 3rd party app that is different between different versions of
Android (such as the different URI authorities used by the provider)
and vendors (We've patched this particular provider for one phone
manufacturer already).

On 11 Apr, 09:52, New Developer secur...@isscp.com wrote:
 Thanks,  Jens

 Yes this is on the emulator

 Can you please tell me more about the Platform sources option  and tutorials 
 to explain just what to do
 Thanks in advance

 On Apr 11, 2011, at 3:10 AM, Jens wrote:

  Are you running this on an emulator? They typically do not contain the
  calendar or calendar provider applications.

  You can build (from the platform sources) and install your own
  calendar provider APK on the emulator though.

  On 10 Apr, 21:08, New Developer secur...@isscp.com wrote:
  anyone solved the use of Google Calendar API ?

  tried the method  from  http://jimblackler.net/blog/?p=151
  content://calendar/calendars   and    
  content://com.android.calendar/calendars

  I get the ERROR
  Failed to find provider info for com.android.calendar

  when I try the  google gdata  api's

  I have the jar files connected via  external libraries
  but this generates, compiles and shows no errors but executes with this 
  runtime ERROR

  Could not find class 'com.google.gdata.client.calendar.CalendarService',

  Thanks in advance

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@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: how do i devlope an android keybord

2011-04-11 Thread Jens
The developer sample doesn't work anymore?

http://developer.android.com/resources/samples/SoftKeyboard/index.html

On 9 Apr, 21:13, ariel arielgordon...@gmail.com wrote:
 so i will try to rephrase my question.

 how i can build a keybord.

 On Apr 9, 2:10 am, Spiral123 cumis...@gmail.com wrote:

  hi Ariel.

  can you rephrase your statement as a question please?  When you say
  it dont run like keybord what do you mean?

  How did you try to run it?  In what way did it not run like keybord?

  On Apr 8, 7:09 am, ariel arielgordon...@gmail.com wrote:

   i try to dwonload SoftKeyboardLanguagePackTemplate but it dont run
   like keybord

-- 
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: Parsing data from a calender on a website

2011-04-08 Thread Jens
You should probably include the URL of the calendar application (if
you can) if you expect any sort of useful response.

But, since you've posted a question for an online calendar that
apparently (?) loads the calendar dynamically with javascript you
could try checking if the calendar uses any AJAX-service on the HTTP
server to retrieve the calendar events (using for instance Firefox
with the Firebug plug-in).

That would typically yield a more parseable source of calendar data
(such as a REST service returning JSON or XML) than trying to pick
apart javascript.




(Checking the TOS for the service might also be a nice gesture, they
may not be too keen on 3rd parties piggy-backing on their calendar)

On 6 Apr, 17:52, Neutron_boy arctikz...@gmail.com wrote:
 I am fairly new to Android, but have some experience reading and
 understanding code, including Java.
 My question is: If I want to parse a URL such as a calender from a web
 page, how do I go about this?

 My thoughts: To pull the XML, do I use text?
 i.e.:

 try {
 URL text = new URL( http:// and here is where I am not sure what to
 have. The script below is the source for the calender in the XML of
 the website
 script type=text/javascript
 src=9278a6f3de5f9e54f2aeeb74ac1f0a7eembedcompiled__en.js/script)

 Do I then follow with XmlPullParserFactgory parserCreator =
 XmlPullParserFactory.newInstance();
 XmlPullParser parser = parserCreator.newPullParser();

 parser.setInput(text.openStream(), null);  Do I still use an open
 stream here?

 rest of code...

 Thanks in advance for the help and insoght

-- 
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 for Android tutorial

2011-04-08 Thread Jens
GDC 2011 had a better example for OGLES2.0

https://code.google.com/p/gdc2011-android-opengl/

On 5 Apr, 18:41, J javier.sed...@gmail.com wrote:
 Hi,

   anybody can sugest a tutorial for OpenGL ES on Android?

   The official documentation is not very extensive...

 Thanks,
 J

-- 
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: Parsing data from a calender on a website

2011-04-08 Thread Jens
Yeah.. that's not going to work for most/any sites.

The output of the average brainless HTML-monkey will not parse with a
proper XML parser - which is why Google themselves saw fit to use
TagSoup internally for HTML rendering (its used for instance to
render HTML in TextView:s).

You can include TagSoup in your app, you'll get a few warnings in
Eclipse since its already in the platform (but hidden as usual).

On 8 Apr, 11:43, harsh chandel harshdchan...@gmail.com wrote:
 hi
 you can use the saxparser or dom parser you can find example
 on android developer.
 to put the whole data in your application and then use it.

 On Apr 6, 8:52 pm, Neutron_boy arctikz...@gmail.com wrote:

  I am fairly new to Android, but have some experience reading and
  understanding code, including Java.
  My question is: If I want to parse a URL such as a calender from a web
  page, how do I go about this?

  My thoughts: To pull the XML, do I use text?
  i.e.:

  try {
  URL text = new URL( http:// and here is where I am not sure what to
  have. The script below is the source for the calender in the XML of
  the website
  script type=text/javascript
  src=9278a6f3de5f9e54f2aeeb74ac1f0a7eembedcompiled__en.js/script)

  Do I then follow with XmlPullParserFactgory parserCreator =
  XmlPullParserFactory.newInstance();
  XmlPullParser parser = parserCreator.newPullParser();

  parser.setInput(text.openStream(), null);  Do I still use an open
  stream here?

  rest of code...

  Thanks in advance for the help and insoght

-- 
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 Contacts backup and sync application

2011-04-06 Thread Jens
Uh, there's a complete sort-of-working-if-you-disregard-the-
embarrassingly-huge-glaring-holes-in-the-default-contacts-app-that-
Google-will-never-fix example @ developer.android.com.

http://developer.android.com/resources/samples/SampleSyncAdapter/index.html

On 31 mar, 14:25, Udayan Warnekar udayan.warne...@gmail.com wrote:
 Hi,

 I am working on a contacts backup and sync.

 The target is to send all details of all contacts to a server (custom
 protocol defined) as a backup.

 During initial launch of application, all the contacts will be queued and
 sent to the server. And after that, a background service will be running all
 time which will listen to new contact addition/ contact update, and this
 new/updated contact will be sent to server by the background service.

 I am using 
 RawContactsEntityhttp://developer.android.com/reference/android/provider/ContactsContr...
 for
 fetching the records.

 I tried using ContentObserver on RawContacts/Data tables to get notification
 of contact addition or contact-change. But, AFAIK, the ContentObserver gives
 notification (onChange()) of changed data in table as a whole and not ID of
 individual record.

 Now my problem is, how to get the exact id's of changed/new records?

 I thought of creating a backup-table to compare with native contacts table
 and get the changed records. But as the number of contacts increase, the
 performance will decease drastically and this will hamper the battery life
 too.

 Can you suggest me, The best way for achieving this contacts backup
 operation from performance and memory usage point of view? Is there any
 other way for contacts sync operation?

 It would be very helpful if anyone can share examples which can help me in
 this.

 --
 Regards,
 *Udayan  Warnekar*

-- 
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 raw (uncompressed) image data from the camera via takePicture(...) callbacks impossible

2011-04-06 Thread Jens
There is an issue concerning accessing raw (uncompressed) image data
on the Android device. The Android API provides a method public final
void takePicture (Camera.ShutterCallback shutter,
Camera.PictureCallback raw, Camera.PictureCallback postview,
Camera.PictureCallback jpeg) to take a picture and then receive
specific callbacks, i.e. when raw image data is available. So far so
good.

But the data buffer passed in via the RAW callback *is always null*.

I can affirm this on current Android version 2.3.3 (Nexus One and
Nexus S). Is there any setting provided to enable access to raw
(uncompressed) image data on Android?

-- 
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: MPlayer for Android

2011-03-28 Thread Jens
You could do like all the others, write a JNI wrapper for ffmpeg and
bundle it with your application - which, depending on how you build
your version of ffmpeg would either be GPL or LGPL - and probably
be .. somewhat problematic to sell in that epic train-wreck that the
US calls a patent system.


On 26 mar, 23:35, Ankur Avlani ankuravl...@gmail.com wrote:
 Since Android is deployed on Linux, I am guessing there should be a
 mechanism in Android to invoke the MPlayer? or any undocumented way?

 Thanks and regards,
 Ankur.

-- 
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: Joins vs. Content provider

2011-03-11 Thread Jens
Did they ever fix that horrible bug in CursorJoiner that used a string
comparison on INTEGER values?

Hepp.. nope they didn't: http://code.google.com/p/android/issues/detail?id=3707

So, the advice regarding CursorJoiner is still Avoid it like the
plague.


On 10 mar, 21:07, Kostya Vasilyev kmans...@gmail.com wrote:
 And then there is:

 http://developer.android.com/reference/android/database/CursorJoiner
 -- Kostya

-- 
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: Contacts.NAME_RAW_CONTACT_ID cant be edited, bug or a future feature?

2011-03-03 Thread Jens
You cannot.

First, look at the code for the provider,

http://www.google.com/codesearch/p?hl=en#cbQwy62oRIQ/src/com/android/providers/contacts/ContactsProvider2.javaq=ContactsProvider2.javal=3887

and you'll notice that it only allows updates for the non-managed
fields on Contacts, i.e. the fields which are not built by the
aggregation function.

However, you might be able to force an update of this particular
managed field by updating all the StructuredName rows of the
RawContacts that make up the Contact row (or just updating the one,
however that could have adverse effects on the aggregation I suspect).

Br,


On 28 Feb, 14:04, Koby koby...@gmail.com wrote:
 No one can help on this issue? it's really important and i'v looked
 everywhere.
 Maybe i am doing something wrong.

-- 
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: Could I exec some codes after my app is installed

2011-01-20 Thread Jens
Yes. Which is bad.

Adding a BroadcastReceiver to your app for something that is spammed
often enough start your app without user interaction .. eventually.

For that extra abusive touch i recommend listening for
ACTION_USER_PRESENT - whenever the user wakes up his device  goes
past the key guard your app will be started/notified.

On 18 Jan, 11:03, Marcin Orlowski webnet.andr...@gmail.com wrote:
 On 18 January 2011 10:32, xeagle xeagle...@gmail.com wrote:

  When my app is downloaded from Market and installed, could some code
  be executed?

 No. Which is good.

-- 
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 to copy contacts in phone to another account ?

2011-01-17 Thread Jens
When your SyncAdapter is initialized by the system you should get a
flag in the Bundle you receive from the SyncManager.

http://developer.android.com/reference/android/content/ContentResolver.html#SYNC_EXTRAS_INITIALIZE

So if this flag is present, copy the contacts to your account.

On 17 Jan, 04:30, Shawn_Chiu qiuping...@gmail.com wrote:
 Hi, all
    I'm developing an android contacts sync application. It would
 create a new account after successfully login. But there are multiple
 accounts in an android phone, no contacts in this new account. If a
 user wants to sync with server, he/she should copy contacts into the
 funambol account in Contacts application, which make it very
 inconvenient for users.
     So I want to load contacts immediately after a funambol account is
 created, or otherwise just sync with the originally phone account.
    Could anybody tell me how to achieve this?
 Thanks.
 BR
 Shawn Chiu

-- 
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: Programmatically specifying a particular APN to be used in my application

2010-12-16 Thread Jens
Afaik the answer is a resounding no. It's possible for the MMS
application to use the MMS APN but that's about as far as it goes.


On 14 Dec, 17:38, Accandme a...@accandme.com wrote:
 I am writing a chat application (still demo stage) for an operator,
 and they want to be able to use a specific APN just for chatting (for
 charging purposes) which gives the user access to the chat server but
 no access to the internet.

 Is it possible to do that on android?
 Can I specify in my own application that it should use the CHAT APN
 while
 all the other applications on the phone keep using the regular default
 internet APN at the same time?

-- 
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: Import Contacts from .vcf file in Android 2.1

2010-11-28 Thread Jens
Afaik there is no standard way to insert contacts from a vcf file
into the contacts provider. The entire package that deals with vCards,
android.pim.vcard is hidden in the SDK and not available unless you're
a big fan of abusing Java Reflection - in short, you should lift the
parser from the android source tree and package it in your app.

If you want to browse the code it uses for serializing and parsing
vCards (both 2.1 and 3.0) it's available here.
http://www.google.com/codesearch/p?hl=en#uX1GffpyOZk/core/java/android/pim/vcard/


On 26 Nov, 06:11, Prateek Jain mrprateekj...@gmail.com wrote:
 Hi All,

 I am able to retrieve all contacts from android in .vcf file using
 following code.

 ContentResolver cr = getContentResolver();
     Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI,null,
 null, null, null);
 String lookupKey =
 cur.getString(cur.getColumnIndex(ContactsContract.Contacts.LOOKUP_KEY));
                         Uri uri =
 Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_VCARD_URI,
 lookupKey);
                         System.out.println(The value is  +
 cr.getType(uri));
                         AssetFileDescriptor fd =
 this.getContentResolver().openAssetFileDescriptor(uri, r);
                         FileInputStream fis = fd.createInputStream();

 I don't know how to use this .vcf file to import all these contacts
 using code. The .vcf file contains all the details of all contacts
 including photos etc.

 Cheers, Prateek

-- 
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: SAX- \n \r not recognized

2010-11-25 Thread Jens
A single LF is the expected output for CR LF sequences.

Normalization is part of the deal with XML.

http://www.w3.org/TR/REC-xml/#sec-line-ends

In short: Find a non-conformant XML parser or encode your content.

On 23 Nov, 06:04, Android Humanoid droid.hu...@gmail.com wrote:
 SAXParserFactory spf = SAXParserFactory.newInstance();
                 SAXParser sp = spf.newSAXParser();

                 XMLReader xr = sp.getXMLReader();
                 SearchHandler sh=new SearchHandler();
                 xr.setContentHandler(sh);
                 String query=xml query;

                 Log.e(Query:Disaplay mail, query);
                 URL url=new URL(query);
                 InputSource is=new InputSource();
                 is.setEncoding(UTF-8);
                 is.setByteStream(url.openStream());
                 xr.parse(is);

 This is the parser am using... SearchHandler extends DefaultHandler.
 My problem is in XML file.. i have a node called emial under that
 content is the attribute, in that content I'll get some text that
 text is have \n and \r.

 Does my SearchHandler recognize the \n or \r symbol or should I use
 any different parser.
 On Nov 23, 9:31 am, Frank Weiss fewe...@gmail.com wrote:

  Please provide more details.

  1. Since you mention symbols, are you using a push or pull SAX parser?
  2. Newlines between *opening* XML elements are typically ignored, not by the
  parser itself, but by the handler.
  3. Newlines in a text node (characters) are significant. Is this the case
  you are talking about?
  4. Newlines in CDATA nodes should also be signifacnt. Is this the case you
  are talking about?
  5. Newlines and carriage returns, 0x0A, 0x0D, are identical whether encode
  in Latin-1 or UTF-8. I doubt this is the issue.

  Can you give a concrete example, 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: 2.1 vs 2.2 ZipInputStream

2010-10-17 Thread Jens
Tim Brays blog entry on multithreading mentions this error and how to
fix it:

http://android-developers.blogspot.com/2010/07/multithreading-for-performance.html



On 16 Okt, 00:34, Adam Hammer adamhamm...@gmail.com wrote:
 I have some code that takes a zip in /assets/raw opens it and reads
 Bitmaps out of it.

 Works great in 2.2, but in 2.1 BitmapFactory.decode() has an error
 reading the inputstream, in logcat I have

 D/skia    ( 1037): --- decoder-decode returned false

 I should also note that my APP is opengl based, not skia based, so
 whatever is happening is likely happening inside Bitmap.

-- 
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: writing Events into Google Calendar in Android failed

2010-10-11 Thread Jens
You're adding an event that's not linked to a row in the calendars
table for one.

Typically you need to set the value of calendar_id to something.
This something better be a valid _id value from the calendars table
or your app will just be filling the provider with crap.

If you're going to be messing around in undocumented providers you
should probably start by looking at the provider code itself:

http://android.git.kernel.org/?p=platform/packages/providers/CalendarProvider.git;a=tree;f=src/com/android/providers/calendar;h=240974b9e76a1c95fb7a20069e0848f913abbef7;hb=25b0f0ee070a5fff18cfcaffa86cb1607941c8a5

Also.. the provider is a bit peculiar on all-day events.. plz make
sure you're pushing them in in UTC-time with the event time zone set
to UTC also. Look at the implementation in the Calendar app itself:

http://android.git.kernel.org/?p=platform/packages/apps/Calendar.git;a=tree;f=src/com/android/calendar;h=e0c3f3cc9249fb9b0cf278a8338e362fdf3e9f4a;hb=14e77164bddf4d29acaca5bb2ff116a697bf9650

--

(or you could just do it with GDATA as M.Murphy suggests and push your
messages via HTTP up to Google which should sync it back to the device
sooner or later).


On 8 Okt, 12:40, Kapuddi kapu...@gmail.com wrote:
 Hello, All:

 when I insert one new Calendar Event into Google calendar from my app,
 the log message was given:
 
 10-05 00:30:44.171: ERROR/DatabaseUtils(8479): Error inserting
 transparency=0 dtstart=128589120 title=TestCalendar _sync_dirty=1
 dtend=128589120 visibility=0 allDay=1 lastDate=1285950628697
 hasAlarm=0 eventStatus=1 into table  Events
 10-05 00:30:44.171: ERROR/DatabaseUtils(8479):
 android.database.sqlite.SQLiteConstraintException: error code 19:
 constraint failed
 10-05 00:30:44.171: ERROR/DatabaseUtils(8479):     at
 android.database.sqlite.SQLiteStatement.native_execute(Native Method)
 

 would you please tell me how to solve it?

 Best Regards,

 Kapuddi

 
 Next is my sample code:
 // Platform: android 2.2 froyo

    private static final String calendarcontentStr =
 content://com.android.calendar/events;

    ContentValues event = new ContentValues();

    //event.put(title, mAct.getString(R.string.read) + :  + title);
    event.put(title, TestCalendar);

    long startTime = startC.getTimeInMillis();
    long endTime = endC.getTimeInMillis();

    event.put(dtstart, startTime);
    event.put(dtend, endTime);
    //event.put(allDay, 1);
    event.put(eventStatus, 1);
    event.put(visibility, 0);
    event.put(transparency, 0);
    event.put(hasAlarm, 0);

    Uri eventsUri = Uri.parse(calendarcontentStr);
    Uri uri = mAct.getContentResolver().insert(eventsUri, event);

-- 
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: Using 3G and WLAN simultaneously

2010-10-02 Thread Jens
Asked and answered.

http://groups.google.com/group/android-developers/browse_thread/thread/4a4d8fbc87d20c/ec0177df1fa1534c?lnk=gstq=We+have+an+application+where+we%27d+like+to+use+the+Wifi+connection+on+a+#ec0177df1fa1534c

Only works on 2.2+ - and the current solution is somewhat hackish..

On 1 Okt, 19:19, Kristian kristian.even...@gmail.com wrote:
 Hello,

 I am working on porting an application which requires at least two
 network interfaces to be available at the same time, for example WLAN
 and 3G. However, I have not been able to figure out how to use
 multiple interfaces simultaneously on Android, the OS seems to remove
 or at least disable one of the interfaces when the other is switched
 on. I have looked through the official API and any relevant examples
 and documentation, but have not figured out how to force the system
 not to switch off one of the interfaces. The closest I got was the
 tethering hotspot source code, as they do something similar to what I
 want to do, but I was not able to fully understand their code.

 My question is therefore, does anyone know how to enable both the WLAN
 and the 3G interface of an Android-phone? It does not matter if it is
 through code, configuring the operating system or something else. The
 phones I have tested with are the Galaxy S and Nexus One, and the
 application is currently written in native code (however, it can
 easily be ported to Java if that is neccessary).

 Thanks in advance for any help.

 -Kristian

-- 
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 can I query the sms by conversation?

2010-09-29 Thread Jens
The URI you're looking for is

  content://mms-sms/conversations?simple=true

and the sort order is date DESC

And as usual, with undocumented APIs from Google - they may change in
the future / differ between handsets etc. - i.e. your app may stop
working and your users start whining.

If you're dead set on doing this I'd suggest adding a heap of error
handling and also test on multiple devices from different vendors.



On 28 Sep, 10:30, feeling3_4 lanwen.ban...@gmail.com wrote:
 Hi All,

 how can I query the latest sms of every conversation. just like native
 sms application in the android phone.

 everytime we start the sms application, it displays the conversations
 sorted by date. how can I achieve this?

 we can query all the sms, but I can't figure out how to query the sms
 by threads.

 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: Synchronization period

2010-09-26 Thread Jens
If you are using 2.2 / api level 8 you could use

http://developer.android.com/reference/android/content/ContentResolver.html#addPeriodicSync(android.accounts.Account,%20java.lang.String,%20android.os.Bundle,%20long)

For 2.1 you're going to have to use the AlarmManager to schedule your
synchronizations.

On 24 Sep, 13:50, Roman Mazur mazur.ro...@gmail.com wrote:
 What is the method to define a sync period for some account?
 ContentResolver allows to set automatic sync flag only. But what is
 period?
 Have I missed something?
 Or have I to schedule sync requests myself using the AlarmManager?

 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] Bluetooth scanning: Issue with HTC Desire - not scanning

2010-09-23 Thread Jens
Hi: I'm developing an application which does scans for nearby
bluetooth devices which are in discoverable mode. On the Google Nexus
One device, the device scanning is working perfectly. But on the HTC
Desire, ACTION_DISCOVERY_FINISHED is called once and does not call
the action BluetoothDevice.ACTION_FOUND. Any other attempts to start
another scan by calling startDiscovery() on BluetoothAdapter class
are ignored. Under some circumstances it works on the HTC Desire for a
few (around 10) bluetooth scanning attempts.

Has HTC introduced a bug on their custom firmware?



The simplest class demonstrating the issue is as follows:

===
public class BluetoothTest extends Activity {

private BluetoothAdapter mBtAdapter;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

mBtAdapter = BluetoothAdapter.getDefaultAdapter();

IntentFilter filter = new
IntentFilter(BluetoothDevice.ACTION_FOUND);
this.registerReceiver(mReceiver, filter);
IntentFilter filter2 = new
IntentFilter(BluetoothAdapter.ACTION_DISCOVERY_FINISHED);
this.registerReceiver(mReceiver, filter2);

mBtAdapter.startDiscovery();
}

private final BroadcastReceiver mReceiver = new
BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();

// When discovery finds a device
if (BluetoothDevice.ACTION_FOUND.equals(action)) {
Log.d(DEBUG, BT Device found);
}

else if
(BluetoothAdapter.ACTION_DISCOVERY_FINISHED.equals(action)) {
Log.d(DEBUG,Entered ACTION_DISCOVERY_FINISHED );
mBtAdapter.startDiscovery();
}

}
};
}
==

-- 
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: Custom Account / Sync adapter: inability to edit contacts?

2010-09-17 Thread Jens
You will most likely not see a fix for either 2.1 or 2.2 for this
issue. Keep your fingers crossed for 3.0?

On 15 Sep, 09:59, BoD bodl...@gmail.com wrote:
 Thank you so much, that confirms what I was afraid of.
 Starred it; hope this will be taken care of soon. Until then, making a
 custom account / sync adapter is not really an option. Like other
 commenters in this issue, unfortunately we only realize that fact
 after doing most of the job :(

 BoD

 On Sep 15, 1:19 am, joebowbeer joe.bowb...@gmail.com wrote:

  Seehttp://code.google.com/p/android/issues/detail?id=5988

  On Sep 14, 3:09 am, BoD bodl...@gmail.com wrote:

   So apparently the answer is no... :(

   BoD

   On Sep 14, 10:37 am, Kostya Vasilyev kmans...@gmail.com wrote:

I believe there was some info on this in the old thread.

--
Kostya Vasilyev --http://kmansoft.wordpress.com

14.09.2010 12:21 пользователь BoD bodl...@gmail.com написал:

 custom contacts are assumed to be sufficiently different from standard
ones,
 and so the built-in...

How disappointing.
Is there a mechanism to inject your own contact editing Activity into
the Contact app?

BoD

PS: I did use search thank you very much - the only related threads I
found were unanswered as I mentioned, maybe you could point me to the
relevant thread?

On Sep 14, 10:01 am, Kostya Vasilyev kmans...@gmail.com wrote:

 This came up on this list before...
 14.09.2010 11:48 пользователь BoD bodl...@gmail.com написал:

 Anybody please?

 I saw this question was asked several times in the past but never
 answered...

--
You received this message because you are subscribed to the Google
Groups Android Developers g...

-- 
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: Adding Contacts in Custom account 2.2

2010-09-17 Thread Jens
There's an old issue filed for this bug:

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

You can either supply your own contact editor and supply activities
for editing and adding contacts to your account or wait for a fix from
Google. The first option results in a very shabby user experience and
the second option is not going to happen anytime soon.

On 13 Sep, 12:06, mikedroid michan...@gmail.com wrote:
 I created a custom account that will create my own contacts but using
 the ContactsContract that is new in the sdk, when i already provided
 values and seems like called every method and constant to be used, the
 only thing that shows in the EditContactActivity and ofcourse having
 my own account for it to be added. The problem is it only shows First
 Name and Last Name fields... no numbers and emails?

-- 
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: Fetch recurrent events

2010-09-09 Thread Jens
That would be the PITA-part wouldn't it. And he's not using any
undocumented Android code, he's accessing a provider through the
standard API:s, which is all well and manageable as long as you
observe basic hygiene and check that the provider is actually
installed and providing the columns you expect.

So dial down the snark, you're currently at a strong 11, we need you
to be somewhere around a solid 7.

On 9 Sep, 08:40, Indicator Veritatis mej1...@yahoo.com wrote:
 Absolutely right. And your 'snarkiness' is fully justified. Nobody
 should be using a private API that Google has advised against using.
 Why, it is extremely rare that one should use a private API at all,
 since the basic policy of Google on undocumented Android code is
 subject to change without notice. It is just bad practice, period.

 We really do not need such bad software engineering practices
 poisoning the Android ecosystem and reputation.

 On Sep 8, 8:46 am, TreKing treking...@gmail.com wrote:

  On Wed, Sep 8, 2010 at 7:12 AM, Jens dunkingbikk...@gmail.com wrote:
   Or, if one doesn't reply with a snarky one-liner:

  I think you mean Or, if you insist on using private APIs which Google
  specifically advises against and want to subject yourself to dealing with
  your app breaking on a myriad of platform versions and phone models with
  each new release.

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


[android-developers] Re: Fetch recurrent events

2010-09-08 Thread Jens
Or, if one doesn't reply with a snarky one-liner:

For Android 2.1 and earlier you could query content://calendar/
events with the following selection rrule IS NOT NULL
For Android 2.2 the authority of the calendar provider was changed, so
you query content://com.android.calendar/events instead.


You should typically refer to:
https://android.git.kernel.org/?p=platform/packages/providers/CalendarProvider.git;a=summary

As you're using an undocumented provider through the standard API:s
you need to be aware that the implementation may vary between vendors,
versions etc - which may or may not be a royal PITA.

On 7 Sep, 08:12, rinyogi rinyog...@gmail.com wrote:
 Hi
 I was wondering how does one fetch recurring events from native
 calendar?

-- 
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: Can Android 2.X connect to 3G and Wifi data networks simultaneously?

2010-09-01 Thread Jens
Yup, i usually don't commit the exact name of hidden constants to
memory, the value of that constant is however defined as enableHIPRI
- and should produce the desired effect of enabling explicit
connection routing over 3G.


On 31 Aug, 14:11, Mark Murphy mmur...@commonsware.com wrote:
 On Tue, Aug 31, 2010 at 7:36 AM, Jens dunkingbikk...@gmail.com wrote:
  Look into the ConnectivtyManager#startUsingNetworkFeature(TYPE_MOBILE,
  ENABLE_HIPRI)

 There is no ENABLE_HIPRI constant in the Android SDK. There is a
 FEATURE_ENABLE_HIPRI
 constant on an internal Phone class, but that is not part of the
 Android SDK either.

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy

 Android Development Wiki:http://wiki.andmob.org

-- 
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: Can Android 2.X connect to 3G and Wifi data networks simultaneously?

2010-08-31 Thread Jens
With Android 2.2 you can route data over the 3G connection explicitly
while still using WiFi. The feature exists in Android 2.1 also but is
*broken* as the high-priority 3G data connection is torn down
incorrectly almost directly.

Look into the ConnectivtyManager#startUsingNetworkFeature(TYPE_MOBILE,
ENABLE_HIPRI) combined with a BroadcastReceiver for the
ConnectivityManager.CONNECTIVITY_ACTION. After the HIPRI connection is
made you need to explicitly route the data using
ConnectivityManager#requestRouteToHost(TYPE_MOBILE_HIPRI, int).

On 13 Juli, 20:07, Mark Murphy mmur...@commonsware.com wrote:
 On Tue, Jul 13, 2010 at 2:01 PM, RickB rick.bullo...@comcast.net wrote:
  We have an application where we'd like to use the Wifi connection on a
  local network (intranet) with no Internet connectivity, and use the 3G
  connection simultaneously as the data connection to the internet.

 Like the WiFi hotspot built into Android 2.2.

  To summarize:

  - We need to connect to two distinct networks at the same time
  - We need data traffic to be properly routed to the appropriate
  network based on its IP address
  - We need both radios (Wifi and 3G) on and active

  This can easily be done on the iPhone, but not sure if it can be done
  on the Android.  Any info/insights welcomed.

 AFAIK, at the SDK level, Android only supports one active connection
 at a time. Custom firmware can clearly arrange for multi-radio
 support, as the WiFi hotspot in 2.2 demonstrates.

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy

 Android 2.2 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] Bluetooth signal strength on Google Nexus One running Android 2.2 (FroYo)

2010-07-22 Thread Jens
Hi!

Is there a possibility to get the bluetooth signal strength to not
connected bluetooth devices?

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: Permanent socket connection drains battery

2010-07-16 Thread Jens
So you're holding a wake lock that keeps the network and CPU on at all
times? Which would prevent the device from sleeping? Yeah, that's a
pretty sure-fire way of draining the battery.

On 15 Juli, 15:41, Namrata puranik.namr...@gmail.com wrote:
  Do you really need to have a socket open at all times?

 yes, my application is based on push technique for which I always need
 to keep it open

 only keep the socket open while the user is actually using the application.

 yup I am doing it. Actually the fuctionality of app includes
 minimization of app and still listening to server push.

 On Jul 15, 6:24 pm, Miguel Morales therevolti...@gmail.com wrote:

  Do you really need to have a socket open at all times?  Why not
  periodically check the server using an Alarm, or only keep the socket
  open while the user is actually using the application.  Also, any loop
  will drain your battery, you might try sleeping at the end of it.

  On Thu, Jul 15, 2010 at 5:39 AM, Namrata puranik.namr...@gmail.com wrote:
   Thanks Mark..

   On Jul 15, 5:06 pm, Mark Murphy mmur...@commonsware.com wrote:
   On Thu, Jul 15, 2010 at 7:56 AM, Namrata puranik.namr...@gmail.com 
   wrote:
any answer?..This is blocking issue for me as it drains batter in
couple of hours.

   You may wish to watch the C2DM presentation from Google I|O 2010, as
   they provide a few hints on how they try to minimize battery usage.

   --
   Mark Murphy (a Commons 
   Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy

   _Android Programming Tutorials_ Version 2.9 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
   For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en

  --http://developingthedream.blogspot.com/,http://diastrofunk.com,http:/..., 
  ~Isaiah 55:8-9

-- 
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] Sections in ListView

2010-07-13 Thread Jens
What is the preferred way to sectionize a ListView by declaring a
header before each section?

-- 
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: Setting and testing state of WiFi Tether hotspot setting in 2.2

2010-07-02 Thread Jens
I'm interested in this too. Is there already any experience with this?

-- 
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] Record audio separately from both microphones on Google Nexus One

2010-07-02 Thread Jens
Hi: The Google Nexus One uses noise cancellation and has therefore two
microphones. My question is, if it is possible to record audio
individually for both microphones?

-- 
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: Picking up contacts: difference in behaviour between HTC and NexusOne - SDK 2.1-update1

2010-06-26 Thread Jens Finkhaeuser
Hi!

Yeah, it helps, thanks. The Android docs contain a more detailed
recipe for maintaining support for older Android versions too (http://
developer.android.com/resources/articles/contacts.html). What gets me
is that on my stock 2.1-update1 (N1) everything works fine with the
deprecated URI, but on my user's Hero (HTC's version of 2.1-update1)
it doesn't. Seems that HTC misread deprecated as unsupported. Ugh.

Ah, well, if you solved your problem that way, I can do too. Thanks!

Jens

-- 
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: Picking up contacts: difference in behaviour between HTC and NexusOne - SDK 2.1-update1

2010-06-25 Thread Jens Finkhaeuser
Hi!

Any news on this? I'm seeing the same - rather, one of my users is
seeing the same on their Hero, and on my N1 everything works.

Thanks,
Jens

-- 
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] Recognize clicks on screen in background service

2010-06-24 Thread Jens
Hi: I have a background service and want to listen to clicks on the
screen by the user. Is there any standard procedure or experience in
doing this?

-Jens

-- 
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] GPS fix status detection

2010-06-18 Thread Jens MF
Hi: Is there a standard solution to determine if the GPS is having a
fix?

Actually I tried to get the status out of the callback method public
void onStatusChanged(String provider, int status, Bundle extras)
{ ... }. But it doesn't get called and the API is quite restraining
on exactly when it's called...

At least the status bar icon seems to know when it has a fix and when
not ...

-Jens

-- 
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: Unable to edit the SyncAdapter Contacts

2010-04-10 Thread Jens
There's a bug report about this intentional misdesign already:

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

On 5 Apr, 18:03, Jegadeesan M jeg...@gmail.com wrote:
 Hi All ,

 Actually i tried the SampleSyncAdapter (Sample Sync Adapter examples),
 its working fine for me. but i am not able to edit/delete the synced
 contacts.  Is this possible to edit those contacts ? please let me
 know.

 Thanks
 Jegadeesan M

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

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: Contacts FAQ?

2010-03-11 Thread Jens
Bug or intentional?

On 3 mar, 20:31, HCH hayeshau...@gmail.com wrote:
 From my reading of the sources (2.1) a custom account contact is not
 editable on the phone outside of the name fields.

 The contact editor does not read the relevant information out of the
 contacts.xml.  It only reads enough to support what you'd see in the
 Facebook type account.

 The source fix would likely be trivial:  just use the fallback source
 mapping as the baseline.

 On Feb 26, 12:49 am, sazilla sazi...@gmail.com wrote:

  Hi Berto,

  do you managed to render the contacts edit fields from a custom
  account using the native contacts app? or for contacts view only?

  thanks
  Carlo

  On 25 Gen, 17:25, Berto mstbe...@gmail.com wrote:

   Just an update for those of you still lost on adding custom accounts,
   sync adapters, etc.  I found a great article here:

  http://www.c99.org/2010/01/23/writing-an-android-sync-provider-part-1...

   Part 2 was the part I needed (how to render the information you synced
   to a contact).

   HTH,

   Berto

   On Jan 22, 4:57 pm, Berto mstbe...@gmail.com wrote:

So, it turns out that anything you put into your own ExternalSource
will never get parsed and therefore (theoretically) never show up.  Or
am I doing something wrong?  The code looks like it will parse only
the information in ContactsDataKind and not the EditField node from
the following:

ContactsSource xmlns:android=http://schemas.android.com/apk/res/
android
    ContactsDataKind
        android:mimeType=com.example.mimetype
        android:icon=@drawable/icon
        android:summaryColumn=data2
        android:detailColumn=data3
        EditField column=data1 title=@string/sample_string /
    /ContactsDataKind
/ContactsSource

Essentially, I have adding an account and the sync adapter working.
But when I try to create a new contact through the contacts app, I can
never see any of the fields I added in the XML structure defined by
meta-data android:name=android.provider.CONTACTS_STRUCTURE
android:resource=@xml/contacts /.  Has anyone figured out an
answer to this problem yet?  I've seen a few posts, but nothing with a
solid answer.

On Jan 12, 4:45 am, Jens dunkingbikk...@gmail.com wrote:

 You could check the Email app - its the current location of the
 Exchange ActiveSync SyncAdapter implementation.

http://android.git.kernel.org/?p=platform/packages/apps/Email.git;a=s...

 Note that this adapter isn't the complete story as any contacts you
 create with your custom accounts will be next to useless without
 looking into the wonky ExternalSource.java integration required for
 custom adapters (unless your happy with contacts that only contains a
 name and photo).

http://android.git.kernel.org/?p=platform/packages/apps/Contacts.git;...

 Sources.java contains the super-special-let's-not-use-our-own-API:s-
 because-that's-hard-work-and-might-require-us-to-actually-document-
 anything-or-heaven-forbid-test-it if-statement that determines the
 layout of your contacts in the Contacts app - and gives super-special
 treatment to accounts with the type com.google or
 com.android.exchange.

 ExternalSource.java contains the sparse and incomplete API
 documentation that you're going to have to use.

 On 9 Jan, 22:16, joebowbeer joe.bowb...@gmail.com wrote:

  On Dec 10 2009, 7:03 am, ydario mc6...@mclink.it wrote:

   I tried addingcontactscode to this project

  http://code.google.com/p/androidaccounts/

  The referenced project no longer exists. Are there any similar
  projects to check out? If not, could someone who has a handle on 
  this
  start anewproject?

-- 
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: HTML parsing with JAVA

2010-02-24 Thread Jens
Tagsoup. You can add the lib to your project or (ab)use reflection to
obtain it from your platform - Google is using themselves.

http://home.ccil.org/~cowan/XML/tagsoup/

On 22 Feb, 06:54, Alisha alisha.a...@gmail.com wrote:
 Hi All,

 I have to parse a html file using java. I have gone through a lot of
 html parsers, but seem to understand none of them. So please help me
 out with the type of parser that should be used for an android app and
 how to parse a  html file.

-- 
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 to deal complex sql in ContentProvider

2010-02-08 Thread Jens
Sure, but in almost all cases it is backed by SQLite - so
intentionally gimping the API that's supposed to be used for
exchanging data across applications is monumentally stupid - since
JDBC is not an alternative on Android.


Designing for the lowest common denominator != good.

 ContentProvider is not a database abstraction -- it's a content store
 abstraction. Not all ContentProviders will be backed up by a SQLite
 database or anything else that interprets SQL. Hence, it is not surprising
 to me that ContentProvider does not support arbitrary SQL statements.

 Since a ContentProvider -- particularly one needing your proposed UPDATE
 statement -- is only needed for inter-process content sharing, you might
 consider switching to a remote service (using AIDL) instead.

 --
 Mark Murphy (a Commons Guy)http://commonsware.com
 Android App Developer Books:http://commonsware.com/books.html

-- 
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: Forcibly using 3G or CDMA network even though wi-fi is available.

2010-02-06 Thread Jens
Uh yeah, that's why they added that particular crazed hack - an
undocumented call to #startUsingNetworkFeature(int, String).

On 3 Feb, 09:31, Anonymous Anonymous firewallbr...@googlemail.com
wrote:
 --

 MMS cannot be sent over wi-fi.Carriers network is mandatory to send/recv.
 The MMSC need to identify from/to the message coming going and it wont be
 possible while using wi-fi.
 So its required to switch to 3g or CDMA even if wi-fi is available.

 2010/2/3 Dongjoon Lee sky...@gmail.com

  The application needs to get some information from operator's server.
  And operator want us to make use operator's network, not wifi, even
  though wifi is available.

  It's very difficult to find solution. May I need to search alternative
  way.

  Anyway, thanks for your advice.

  Best regards,
  Dongjoon.

  On 1월15일, 오후7시17분, Jens dunkingbikk...@gmail.com wrote:
   For the same reason you added the feature that allows the MMS
   application to switch to a specific APN even when WiFi is
   available. lots of mobile apps require you to go through a
   specific APN - for billing purposes amongst other things.

   Dongjoon: You could check if the same crazed hack that allows the MMS
   application to work can be used by you?

   Br
   Jens

   On 14 Jan, 19:07, Dianne Hackborn hack...@android.com wrote:

Sorry, I don't believe you can.  Why do you want to do this?

On Thu, Jan 14, 2010 at 12:39 AM, Dongjoon Lee sky...@gmail.com
  wrote:
 Hello.

 My question is, as you can see the title, can i use3gnetwork even
 though wi-fi is available?
 i heard wi-fi priority is higher than3gor cdma. can i change that
 priority in specific application?
 this is one of requirement of the project. if anybody has an answer,
 plz help me.

 thanks in advance.

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to
  android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
  android-developers%2bunsubs-cr...@googlegroups.comandroid-developers%252bunsubs-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.comandroid-developers%2bunsubscr...@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: Adding contacts to a custom account

2010-01-22 Thread Jens
The problem lies within the broken parts of the Contacts app, so a
proper implementation of custom contacts sync is effectively dead for
all devices running 2.0.1 (and probably 2.1).

On 21 Jan, 00:05, sazilla sazi...@gmail.com wrote:
 did anyone fix this problem? any suggestion?

 does it mean that there's no application providing contacts sync?

 On Dec 29 2009, 3:14 pm, sazilla sazi...@gmail.com wrote:

  Hi Vadim,

  Actually for what I've understood thecustommime type can be used to
  specify how to render thecustomfields when you view the contact not
  while you edit it. I've found a bug in the Contacts application
  (around line 
  178):http://android.git.kernel.org/?p=platform/packages/apps/Contacts.git;...

  The ExternalSource component should be able to read the xml file you
  mentioned above and render it in the contacts editing screen, but...
  it doesn't.

  The Facebook application, for example, defines acustomfiled (the FB
  profile) in the contacts.xml file, and it i rendered correctly when
  you view a FB contact, but the FBaccountin Android is a read onlyaccount, 
  it means that in any case you cannot create/edit contacts
  from android.

  Up to now I found only a workaroun, filtering the intent launched
  everytime a contact must be created/edited and show acustomcontacts
  edit screen, for our contactsaccount, or forward the request to the
  default contacts app if the contact belongs to a differentaccount.

  Let me know if you've found any other workaround.

  Thank you

  Carlo

  On Dec 23, 3:16 pm, Vadim Vohmjanin vadim...@gmail.com wrote:

   I have found something...

   For thatcustomData row to appear in the Contacts app, you'll need to
   associate yourcustomMIME-type with XML that describes how to render
   the UI.  The only current way of doing this is to define a sync
   adapter service and add meta-data definition inside, something
   like this:

   meta-data android:name=android.provider.CONTACTS_STRUCTURE
    android:resource=@xml/contacts /

   So you have 2 metas there, one is for sync adapter.

   Then define the contacts XML inside your app ./res/xml/contacts.xml:

   --snip--
    ContactsSource xmlns:android=http://schemas.android.com/apk/res/
   android;
        ContactsDataKind
            android:mimeType=vnd.com.example.voip.cursor.item/phone_v2
            android:icon=@drawable/icon
            android:summaryColumn=data2
            android:detailColumn=data3 /
    /ContactsSource
   --snip--

   I have tried this, but i didn't get it working. It sure effects in
   some way. But i don't get desirable result.

   Any help pls?

   On Dec 18, 4:32 pm, Vadim Vohmjanin vadim...@gmail.com wrote:

I faced the same problem.

I'm doing the research now. If you have found how to do it, please
provide this info. I'd be very greatfull.

I also wanted to know, what exactly way do you createcustomaccount?
As i understoodaccountcreation currently *requires* a developer to
implement a
service that extends AbstractThreadedSyncAdapter and publishes the
correct intent in
its manifest.
When this is not the case, the Accounts  Sync settings does not
handle the case
where this is not defined and causes the NPE in the core process that
causes the
reboot.
It is recommended that this defect be patch and/or the documentation
updated to include the
proper procedures and requirements for creation of anaccountin
Android.

Alsoaccountcreation requires of the authenticator to be implemented
for theaccounttype.
In order to be an authenticator developer must extend
AbstractAccountAuthenticator class, provider implementations for the
abstract methods and write a service that returns implemented
AccountAuthenticator.

Or there is more simple way to create acustomaccountfor Contacts?

On Dec 15, 4:52 pm, sazilla sazi...@gmail.com wrote:

 Hi everyone,

 I encountered an issue while configuring my ownaccountfor android
 contacts sync. When the user choses to add a new contact to thecustom
account, only the name fields and the photo are showed. This behaviour
 can be found in the ExternalSource.java android source file.

 My question is, if I don't want to addcustomcontacts fields for my
account, how can I configure theaccountto show all the standard
 fields in the contacts application in the same way the googleaccount
 does?

 Thank you

 Carlo

-- 
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: Forcibly using 3G or CDMA network even though wi-fi is available.

2010-01-15 Thread Jens
For the same reason you added the feature that allows the MMS
application to switch to a specific APN even when WiFi is
available. lots of mobile apps require you to go through a
specific APN - for billing purposes amongst other things.

Dongjoon: You could check if the same crazed hack that allows the MMS
application to work can be used by you?

Br
Jens

On 14 Jan, 19:07, Dianne Hackborn hack...@android.com wrote:
 Sorry, I don't believe you can.  Why do you want to do this?



 On Thu, Jan 14, 2010 at 12:39 AM, Dongjoon Lee sky...@gmail.com wrote:
  Hello.

  My question is, as you can see the title, can i use 3g network even
  though wi-fi is available?
  i heard wi-fi priority is higher than 3g or cdma. can i change that
  priority in specific application?
  this is one of requirement of the project. if anybody has an answer,
  plz help me.

  thanks in advance.

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@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: Contacts FAQ?

2010-01-12 Thread Jens
You could check the Email app - its the current location of the
Exchange ActiveSync SyncAdapter implementation.

http://android.git.kernel.org/?p=platform/packages/apps/Email.git;a=summary

Note that this adapter isn't the complete story as any contacts you
create with your custom accounts will be next to useless without
looking into the wonky ExternalSource.java integration required for
custom adapters (unless your happy with contacts that only contains a
name and photo).

http://android.git.kernel.org/?p=platform/packages/apps/Contacts.git;a=tree;f=src/com/android/contacts/model;h=e58985879d5b88e3374b3fad847da3786e47ee94;hb=08d3445a85a65c56c0f09d24f871ffbd3b93187f

Sources.java contains the super-special-let's-not-use-our-own-API:s-
because-that's-hard-work-and-might-require-us-to-actually-document-
anything-or-heaven-forbid-test-it if-statement that determines the
layout of your contacts in the Contacts app - and gives super-special
treatment to accounts with the type com.google or
com.android.exchange.

ExternalSource.java contains the sparse and incomplete API
documentation that you're going to have to use.



On 9 Jan, 22:16, joebowbeer joe.bowb...@gmail.com wrote:
 On Dec 10 2009, 7:03 am, ydario mc6...@mclink.it wrote:

  I tried addingcontactscode to this project

 http://code.google.com/p/androidaccounts/

 The referenced project no longer exists. Are there any similar
 projects to check out? If not, could someone who has a handle on this
 start a new project?
-- 
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: Contacts FAQ?

2010-01-12 Thread Jens
Developing in the SDK you can use the account type com.google - this
will trick the Contacts app into displaying all the fields without
trying to use the broken contact field format Brian hinted at earlier
in this thread. This will of course probably not work in an actual
device where the com.google authenticator is already added.

br
Jens

On 15 Dec 2009, 12:45, sazilla sazi...@gmail.com wrote:
 Hi everyone,

 I encountered an issue while configuring my own account for 
 androidcontactssync. When the user choses to add a new contact to the custom
 account, only the name fields and the photo are showed. This behaviour
 can be found in the ExternalSource.java android source file.

 My question is, if I don't want to add customcontactsfields for my
 account, how can I configure the account to show all the standard
 fields in thecontactsapplication in the same way the google account
 does?

 Thank you

 Carlo
-- 
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: Extending contacts

2010-01-11 Thread Jens
This needs to be addressed... The whole ContactsContract API is
starting to look like a perfect lesson in how not to publish an API.
-- 
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: Playing a audio stream not working using MediaPlayer

2009-11-30 Thread Jens-Christian Larsen
Thank you Klaus for the response.
What you say is also what I have come to understand.
I think I will try to download a local copy of the streamed content
and play that instead.
In any case the MediaPlayer class seem not to be working correctly in
most streaming audio cases.
I guess I will have to look into making it a service too.

best regards
Jens-Christian

On 30 Nov., 11:57, Nugman klaus.nuta...@googlemail.com wrote:
 First of all the MediaPlayer does not support all music streaming
 formats, as I understood.
 I also struggeling with it.
 For me it is working to play a mp3 file located on a server. Try this
 first.
 But it seems that m3u or aac is not supported at all. (Implement a
 ErrorListener to see the error)
 I hope that I am wrong in this case, but I cant get it to work,
 either.
 Maybe you can decrypt the m3u file yourself to get the mpeg itself.
 Let me know how this works.

 Nevertheless the best thing is, to create a remote service (or a
 thread) that prepares and plays the music. So it does not disturb the
 main gui.

 Sorry that is all I know.
 Greets Klaus

 On 27 Nov., 11:25,Jens-ChristianLarsen jenschrlar...@gmail.com
 wrote:

  I am trying to make a very simple radio player for Android and I
  cannot get the audio streaming to work. In my latest attempt it plays
  for about 1 second and stops for some streams and it doesnt work at
  all for some other streams. Logcat doesn't give much useful
  information to me.
  I am testing on HTC Hero (Android 1.5).

  If I hook the completion and buffer events I see the audio gets a
  complete event but it keeps buffering.
  Is there anything wrong with the code below?
  Should I be able to stream the the audio streams below?
  Is there a complete example somewhere of a working radio streaming?

  Thanks for any and all suggestions.

  public class MyActivity extends Activity implements OnPreparedListener
  {
          MediaPlayer streamPlayer = new MediaPlayer();

          public void onPrepared(MediaPlayer mp) {
                  streamPlayer.start();
          }

          @Override
          public void onCreate(Bundle savedInstanceState) {
                  super.onCreate(savedInstanceState);
                  String path = http://www.nch.com.au/acm/sample.aac;;
                  // String path = http://radio.bis.bg:8000/buddhabar;;
                  // String path = 
  http://kzsulive.stanford.edu/audio/kzsu-1-24.m3u;;
                  try {
                          Uri uri = Uri.parse(path);
                          streamPlayer.reset();
                          streamPlayer.setDataSource(this, uri);
                          
  streamPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
                          streamPlayer.setOnPreparedListener(this);
                          streamPlayer.prepareAsync();
                  } catch (Exception e) {
                          e.printStackTrace();
                  }
                  setContentView(R.layout.main);
          }

  }



-- 
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] Playing a audio stream not working using MediaPlayer

2009-11-28 Thread Jens-Christian Larsen
I am trying to make a very simple radio player for Android and I
cannot get the audio streaming to work. In my latest attempt it plays
for about 1 second and stops for some streams and it doesnt work at
all for some other streams. Logcat doesn't give much useful
information to me.
I am testing on HTC Hero (Android 1.5).

If I hook the completion and buffer events I see the audio gets a
complete event but it keeps buffering.
Is there anything wrong with the code below?
Should I be able to stream the the audio streams below?
Is there a complete example somewhere of a working radio streaming?

Thanks for any and all suggestions.


public class MyActivity extends Activity implements OnPreparedListener
{
MediaPlayer streamPlayer = new MediaPlayer();

public void onPrepared(MediaPlayer mp) {
streamPlayer.start();
}

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
String path = http://www.nch.com.au/acm/sample.aac;;
// String path = http://radio.bis.bg:8000/buddhabar;;
// String path = 
http://kzsulive.stanford.edu/audio/kzsu-1-24.m3u;;
try {
Uri uri = Uri.parse(path);
streamPlayer.reset();
streamPlayer.setDataSource(this, uri);

streamPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
streamPlayer.setOnPreparedListener(this);
streamPlayer.prepareAsync();
} catch (Exception e) {
e.printStackTrace();
}
setContentView(R.layout.main);
}
}

-- 
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: Hmm... at last ADC2 is out of our way ... tell about your app and experience

2009-09-03 Thread Jens Finkhaeuser

Hey all!

My submission is PackRat. It's a media collection manager... I collect
a lot of books, CDs, you name it, and hardly remember what exactly I
have and don't have. Writing that app scratched a fairly persistent
itch for me. You can find out more about it on http://packrat.unwesen.de/

Jens
--~--~-~--~~~---~--~~
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: Invoking Activity from PendingIntent in NotificationManager

2009-06-23 Thread jens hohl

Thanks,

finally i got it working. The Log was empty but i forget to declare it
in the Manifest.xml

On 22 Jun., 19:42, Josh Guilfoyle jast...@gmail.com wrote:
 Check with adb logcat to see if there was a problem launching your
 activity.  My initial guess is that you forgot to declare this
 activity in the AndroidManifest.xml file.  You also should not need to
 use FLAG_CANCEL_CURRENT, nor should you need to use
 Main.this.getBaseContext, as any Context would suffice, including
 Main.this.

 On Jun 22, 1:05 am, mac-systems jens.h...@gmx.de wrote:

  Hello,

  i want to Inform the User about an Event from my Application using the
  NotificationManager and then invoking a Activity with details about
  the Event.

  As far as i know it should work like this:

                                  final NotificationManager mManager = 
  (NotificationManager)
  getSystemService(Context.NOTIFICATION_SERVICE);

                                  Intent intent = new Intent(Main.this,
  AlarmNotificationDetail.class);

                                  Notification notification = new 
  Notification(R.drawable.icon,
  Notify, System.currentTimeMillis());
                                  notification.setLatestEventInfo(Main.this, 
  App Name,
  Description of the notification,PendingIntent
                                                  
  .getActivity(Main.this.getBaseContext(), 0, intent,
 PendingIntent.FLAG_CANCEL_CURRENT));
                                  mManager.notify(815, notification);

  This put an Event in my Statusbar, but it do not forward to the
  AlarmNotificationDetail.class Activity. Main.this is the Context from
  which this Event is triggered.

  The Activity to Invoke looks live this and should  bring up a Toast
  when created:

  public class AlarmNotificationDetail extends Activity
  {

          /*
           * (non-Javadoc)
           *
           * @see android.app.Activity#onCreate(android.os.Bundle)
           */
          @Override
          protected void onCreate(Bundle savedInstanceState)
          {
                  super.onCreate(savedInstanceState);
                  setContentView(R.layout.alarmnotificationdetail);

                  Toast.makeText(this, this is a toast, Toast.LENGTH_LONG);
          }

  }

  Anyone can help me out ?

  regards,
  Mac
--~--~-~--~~~---~--~~
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] Voice calls which uses its own audio instead of the build-in microphone

2009-04-22 Thread Jens K.

Hi there,

we're a group of students and trying to implement some kind of voice
cryptography over a gsm connection (without modifing any gsm related
codecs, we render pure audio which gets transmitted via gsm). Is it
possible to initiate a voice call and transmit our generated audio
signal (means bypassing the microphone as the primary audio source for
that call)?
I write this because I'm slightly worried after reading some posts on
this list/group which states that the android.telphony APIs are
private and can't be called from processes outside the the telephone
subsystem.

Kind regards,
 Jens
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---