Search Results

Search found 45 results on 2 pages for 'synic'.

Page 1/2 | 1 2  | Next Page >

  • c# - wmplib - playing 2 mp3 files but can get them in synic

    - by Ciarán
    I have 2 windowsMediaPlayer objects setup Both objects have the same mp3 song file but when I play them at the same time they are out of sync by a few seconds. The code I call to play them looks like this sound1.controls.play(); sound2.controls.play(); Is it just because one play method is executed before the other and thus one fast then the other. Is their anyway I could sync them? I have tired messing with the rate of one track to match the other, but not getting it prefect. Thanks

    Read the article

  • Remote desktop solution for controlling a remote OS X machine in Linux

    - by synic
    The "server" (the host I'm trying to connect to) is Snow Leopard. The "client" is Ubuntu 10.04. I want something like a remote desktop server running on OS X that I can connect to and control from the Linux machine. Something cheap or free would be best. Something that always runs on the OS X machine so that I never have to attach a monitor or a keyboard. I don't want to use VNC, because, well, VNC sucks over this network. Any ideas?

    Read the article

  • ArrayAdapter and ListView - ArrayIndexOutOfBoundsException

    - by synic
    I'm really hoping someone can help me out with this one. I've been stuck on it forever. Occasionally, when someone is using my app, it'll force close with this exception: java.lang.ArrayIndexOutOfBoundsException at android.widget.AbsListView$RecycleBin.addScrapView(AbsListView.java:3572) at android.widget.AbsListView.trackMotionScroll(AbsListView.java:2487) at android.widget.AbsListView.onTouchEvent(AbsListView.java:2001) at android.widget.ListView.onTouchEvent(ListView.java:3234) at android.view.View.dispatchTouchEvent(View.java:3709) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:874) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:924) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:924) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:924) at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1695) at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1116) at android.app.Activity.dispatchTouchEvent(Activity.java:2068) at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1679) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:924) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:924) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:924) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:924) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:924) at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1695) at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1116) at android.app.Activity.dispatchTouchEvent(Activity.java:2068) at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1679) at android.view.ViewRoot.handleMessage(ViewRoot.java:1697) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:123) at android.app.ActivityThread.main(ActivityThread.java:4568) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:521) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) at dalvik.system.NativeStart.main(Native Method) However, I cannot figure out why. It's relatively rare, non-reproducable, and the stacktrace is completely unhelpful because it doesn't include any of my code. Is it a bug in Android itself?

    Read the article

  • android.app.Application subclass, onTerminate is not being called

    - by synic
    From the documentation for android.app.Application: "Base class for those who need to maintain global application state" I am using my own subclass to maintain an object that I'm using to query a server. Also from the documentation: "onTerminate() Called when the application is stopping." However, onTerminate() in my class is never called. I press the back button while viewing my main activity, and everything seems to shut down. My main Activity's onDestroy() method is called and isFinishing() returns true, but my android.app.Application's onTerminate() method is never called. Why is this? What am I missing? Is there something that is keeping it open?

    Read the article

  • What is in scala-android.jar?

    - by synic
    I've been trying to experiment with developing Android applications with Scala. I've gotten to the point where I can get the app to compile, but there are no helper functions for things like: button.setOnClickListener( () => { text.setText("test") }) (I'm talking about the closure there) I see lots of references to scala-android.jar, and have this file in my project, but I'm not sure what it does, or how to use it. I get the feeling it has these helper conversion functions, but I'm not sure. Running jar -tvf scala-android.jar on the file gives me this: 401 Sun Jun 06 10:06:02 MDT 2010 scala/Function0$class.class 431 Sun Jun 06 10:06:02 MDT 2010 scala/Function0.class 572 Sun Jun 06 10:06:02 MDT 2010 scala/Function1.class 282 Sun Jun 06 10:06:02 MDT 2010 scala/ScalaObject$class.class 271 Sun Jun 06 10:06:02 MDT 2010 scala/ScalaObject.class 458 Sun Jun 06 10:06:02 MDT 2010 scala/runtime/BoxedUnit.class If this isn't what I'm looking for, is there a simple library that'll do conversions for this kind of stuff?

    Read the article

  • SharedPreferences.onSharedPreferenceChangeListener not being called consistently

    - by synic
    I'm registering a preference change listener like this (in the onCreate() of my main activity): SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); prefs.registerOnSharedPreferenceChangeListener( new SharedPreferences.OnSharedPreferenceChangeListener() { public void onSharedPreferenceChanged( SharedPreferences prefs, String key) { System.out.println(key); } }); The trouble is, the listener is not always called. It works for the first few times a preference is changed, and then it is no longer called until I uninstall and reinstall the app. No amount of restarting the application seems to fix it. I found a mailing list thread reporting the same problem, but no one really answered him. What am I doing wrong?

    Read the article

  • JSON: Jackson stream parser - is it really worth it?

    - by synic
    I'm making pretty heavy use of JSON parsing in an app I'm writing. Most of what I have done is already implemented using Android's built in JSONObject library (is it json-lib?). JSONObject appears to create instances of absolutely everything in the JSON string... even if I don't end up using all of them. My app currently runs pretty well, even on a G1. My question is this: are the speed and memory benefits from using a stream parser like Jackson worth all the trouble? By trouble, I mean this: As far as I can tell, there are three downsides to using Jackson instead of the built in library: Dependency on an external library. This makes your .apk bigger in the end. Not a huge deal. Your app is more fragile. Since the parsing is not done automatically, it is more vulnerable to changes in the JSON text that it's parsing. I'm extremely worried that malformed JSON will result in infinite loops (as pull parsing requires a lot of while loops). Writing code to parse JSON via a stream parser is ugly and tedious.

    Read the article

  • ListView/ListAdapter paging

    - by synic
    I'm trying to implement paging in a custom ListAdapter. Right now I'm just making the request for the next page when the last item in the ListView becomes visible, by checking in getView() if position is >= the size of ListAdapter.getCount(). It works fine, but I'm wondering if there's a better way (or a different way) that will only make the request once the last item in the list is actually visible to the user. Anyone know of a way?

    Read the article

  • PendingIntent from notification and application history conflicts

    - by synic
    I'm creating a notification with something similar to the following: Intent ni = new Intent(this, SomeActivity.class); ni.putExtra("somestring", "somedata"); PendingIntent contentIntent = PendingIntent.getActivity(this, 0, ni, PendingIntent.FLAG_UPDATE_CURRENT|PendingIntent.FLAG_ONE_SHOT); Context context = getApplicationContext(); notification.setLatestEventInfo(context, res.getString(R.string.app_name), text, contentIntent); The key here is the extra data on the Intent for the notification. Once I click on the notification and it brings up SomeActivity, it brings up the activity and the extra data is available. However, if I exit the app, hold the home button until the recent activities list comes up, and choose to open the app again, the extra data is still passed. Is there a way I can make this data get passed only if the app is opened via the Notification, and not from the recent activities list?

    Read the article

  • How to declare NSString constants for passing to NSNotificationCenter

    - by synic
    I've got the following in my .h file: #ifndef _BALANCE_NOTIFICATION #define _BALANCE NOTIFICATION const NSString *BalanceUpdateNotification #endif and the following in my .m file: const NSString *BalanceUpdateNotification = @"BalanceUpdateNotification"; I'm using this with the following codes: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateBalance:) name:BalanceUpdateNotification object:nil]; and [[NSNotificatoinCenter defaultCenter] postNotificationName:BalanceUpdateNotificatoin object:self userInfo:nil]; Which works, but it gives me a warning: Passing argument 1 of 'postNotificationName:object:userInfo' discards qualifiers from pointer target type So, I can cast it to (NSString *), but I'm wondering what the proper way to do this is.

    Read the article

  • Pressing back button in ActivityGroup causes it to pause, and then continue shutting down the next t

    - by synic
    Pressing the back button causes onPause to be called, and the app stays paused until it is re-launched by clicking on the icon, at which point, onDestroy gets called, and the main activity continues to shut down. Simple class to demonstrate. Note, as far as I can tell, this only happens on the Nexus One. I can't reproduce it in the emulator or on my Droid. package com.vimtips.testshutdown; import android.app.ActivityGroup; import android.os.Bundle; import android.util.Log; import android.view.KeyEvent; public class MainActivity extends ActivityGroup { private static final String TAG = "MainActivity"; private int counter = 3; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } public boolean onKeyDown(int keyCode, KeyEvent event) { if(keyCode == KeyEvent.KEYCODE_BACK) { if(counter-- > 0) return true; } return super.onKeyDown(keyCode, event); } @Override public void onPause() { super.onPause(); Log.d(TAG, "onPause called"); } @Override public void onDestroy() { super.onDestroy(); if(isFinishing()) { Log.d(TAG, "Shutting down"); } } } And here's the log: I/ActivityManager( 132): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10100000 cmp=com.vimtips.testshutdown/.MainActivity } I/ActivityManager( 132): Displayed activity com.vimtips.testshutdown/.MainActivity: 305 ms (total 305 ms) D/MainActivity( 1393): onPause called I/ActivityManager( 132): Displayed activity com.vimtips.testshutdown/.MainActivity: 302 ms (total 302 ms) D/MainActivity( 1393): Shutting down This doesn't appear to happen on a normal Activity, just an Activity group, though looking at Android's sourcecode, I can't figure out why. It's causing some serious problems with my app. Anyone know why this would happen?

    Read the article

  • Cropping an image, saving output to a new file and get crop coordinates

    - by synic
    I'm interfacing with a service that allows you to upload an image, and also upload coordinates of a thumbnail of that image. I'm thinking that (if there isn't some sort of prefab Activity specifically for this) that I can use Android's crop utility. The only problem is that I can't overwrite the original file, the crop window needs to have a custom message (instead of "crop image"), and I'll need the coordinates of the crop. Is this possible? Is there another way to do this without writing my own Activity?

    Read the article

  • Disk based HashMap

    - by synic
    Does Java have (or is there a library available) that allows me to have a disk based HashMap? It doesn't need to be atomic or anything, but it will be accessed via multiple threads and shouldn't crash if two are accessing the same element at the same time. Anyone know of anything?

    Read the article

  • Another ArrayIndexOutOfBoundsException in ListView

    - by synic
    This one is different than the other one I posted. Any ideas? java.lang.IndexOutOfBoundsException: Invalid location 14, size is 1 at java.util.ArrayList.get(ArrayList.java:341) at android.widget.HeaderViewListAdapter.getView(HeaderViewListAdapter.java:188) at android.widget.AbsListView.obtainView(AbsListView.java:1256) at android.widget.ListView.makeAndAddView(ListView.java:1668) at android.widget.ListView.fillUp(ListView.java:667) at android.widget.ListView.fillGap(ListView.java:613) at android.widget.AbsListView.trackMotionScroll(AbsListView.java:2531) at android.widget.AbsListView$FlingRunnable.run(AbsListView.java:2353) at android.os.Handler.handleCallback(Handler.java:587) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:123) at android.app.ActivityThread.main(ActivityThread.java:4595) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:521) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) at dalvik.system.NativeStart.main(Native Method)

    Read the article

  • Problem with EditText.requestFocus()

    - by synic
    In the onCreate() of an activity, I've got a call to requestFocus() on an EditText. Immediately after, I've got the following: System.out.println(mEdit.isFocusableInTouchMode()); System.out.println(mEdit.isFocusable()); System.out.println(mEdit.isFocused()); These were just put in while I was trying to figure out what is wrong with this activity... they all print "true". However, as you may have guessed, the EditText does NOT have focus, and if I try to start typing, nothing happens. I have to click on the EditText to being typing. I can't see that anything else has focus, but obviously something has to have it.. how can I find out what it is?

    Read the article

  • Creating a bitmask parameter for a function or method

    - by synic
    I noticed a lot of Android functions have a parameter that you can pass in that's a bitmask, for different options, like on PendingIntent, you can pass in things like you can call getActivity() with PendingIntent.FLAG_CANCEL_CURRENT|PendingIntent.FLAG_NO_CREATE. I'm wondering how I can create a function that has a parameter like this?

    Read the article

  • Solution for cleaning an image cache directory on the SD card

    - by synic
    I've got an app that is heavily based on remote images. They are usually displayed alongside some data in a ListView. A lot of these images are new, and a lot of the old ones will never be seen again. I'm currently storing all of these images on the SD card in a custom cache directory (ala evancharlton's magnatune app). I noticed that after about 10 days, the directory totals ~30MB. This is quite a bit more than I expected, and it leads me to believe that I need to come up with a good solution for cleaning out old files... and I just can't think of a great one. Maybe you can help. These are the ideas that I've had: Delete old files. When the app starts, start a background thread, and delete all files older than X days. This seems to pose a problem, though, in that, if the user actively uses the app, this could make the device sluggish if there are hundreds of files to delete. After creating the files on the SD card, call new File("/path/to/file").deleteOnExit(); This will cause all files to be deleted when the VM exits (I don't even know if this method works on Android). This is acceptable, because, even though the files need to be cached for the session, they don't need to be cached for the next session. It seems like this will also slow the device down if there are a lot of files to be deleted when the VM exits. Delete old files, up to a max number of files. Same as #1, but only delete N number of files at a time. I don't really like this idea, and if the user was very active, it may never be able to catch up and keep the cache directory clean. That's about all I've got. Any suggestions would be appreciated.

    Read the article

  • 9patch border issues

    - by synic
    Is there a trick to making 9patch images with single pixel borders? I'm not talking about the single pixel black borders that you use to define the stretchable and content areas. I'm talking about the image itself. If I create an image that has a 1 pixel border around it, often times android will pick one of the edges and stretch it to 2 (or sometimes more) pixels, even though I specifically left the edges out of the stretchable area in the draw9patch utility.

    Read the article

  • Android and config.xml

    - by synic
    Looking in the android sdk folders, I've found a file called values/config.xml. This seems to be somewhere that you can define values for later use in layouts and animations. Given the config.xml: <resources> <string name="config_somePadding">50dip</string> </resources> How would I reference this to use as the layout_height in a layout xml file? @string/config_somePadding is actually the only one I've found that doesn't throw an error in Eclipse (even though there isn't a config_somePadding in values/strings.xml), but it appears to just put an empty string.

    Read the article

  • Using resource values as layout attributes (config.xml)

    - by synic
    Looking in the android sdk folders, I've found a file called values/config.xml. This seems to be somewhere that you can define values for later use in layouts and animations. Given the config.xml: <resources> <string name="config_somePadding">50dip</string> </resources> How would I reference this to use as the layout_height in a layout xml file? @string/config_somePadding is actually the only one I've found that doesn't throw an error in Eclipse (even though there isn't a config_somePadding in values/strings.xml), but it appears to just put an empty string. In the sdk, they use an integer for animation duration. They reference it like this: android:duration="@android:integer/config_longAnimTime". Is there a way to use values that aren't integers in the layout_height attribute?

    Read the article

  • Allow swipe-to-delete in one instance of UITableViewDataSource, but not another

    - by synic
    I've got a UITableViewDataSource that I'm using for two different UITableViews. In one of the table views, I want to enable swipe-to-delete, so I've implemented tableView:commitEditingStyle:forRowAtIndexPath, and it works as expected. However, in another table, I want to disable that feature. I've got it working by making two UITableViewDataSource classes, one subclassing the other, and I only implement tableView:commitEditingStyle:forRowAtIndexPath in the subclass. I call them RecipientModel and RecipientModelEditable. I'm wondering if there's a better way.

    Read the article

  • Setting the UIImagePickerController delegate throws a warning about UINavigationControllerDelegate

    - by synic
    The code: UIImagePickerController *picker = [[UIImagePickerController alloc] init]; picker.delegate = self; picker.sourceType = UIImagePickerControllerSourceTypeCamera; [self.navigationController presentModalViewController:picker animated:YES]; [picker release]; The warning, which shows up on the picker.delegate = self; line: Class 'CardEditor' does not implement the 'UINavigationControllerDelegate' protocol Why does the UIImagePickerController care if my class implements the UINavigationControllerDelegate protocol?

    Read the article

  • Creating a drawable rectangle in xml with one gradient on the top half and another on the bottom hal

    - by synic
    I'm trying to create a drawable in xml, a rectangle with one gradient on the top half, and another on the bottom half. This is NOT the way to do it, apparently: <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape android:shape="rectangle"> <gradient android:startColor="#5a5a5a88" android:endColor="#14141488" android:angle="270" android:centerX="0.25"/> </shape> </item> <item> <shape android:shape="rectangle" android:top="80px"> <gradient android:startColor="#5aff5a88" android:endColor="#14ff1488" android:angle="270" android:centerX="0.25"/> </shape> </item> </layer-list> How can I do this, preferably in a way that makes it stretchable to any height?

    Read the article

  • EXC_BAD_ACCESS when trying to release an ABRecordRef

    - by synic
    I've got the following class that is a wrapper around an ABPerson (ABRecordRef): @interface Recipient : NSObject { ABRecordRef person; } - (id)initWithPerson:(ABRecordRef)person; @end @implementation - (id)initWithPerson:(ABRecordRef)_person { if(self = [super init]) person = CFRetain(_person); return self; } - (void)dealloc { if(person) CFRelease(person); [super dealloc]; } @end I've left some of the methods out, but they aren't relevant to this question. Everything works fine, except I get an EXC_BAD_ACCESS on the if(person) CFRelease(person); line. Why does this happen? I'm not calling CFRelease or CFRetain at all anywhere else in my app.

    Read the article

1 2  | Next Page >