I am doing iPhone development and how to make CGRect return double value? I found there was a macro "#define CGFLOAT_IS_DOUBLE", but how can I change it?
I'm doing a Gdata Blogger from Android device:
GoogleLoginServiceHelper.getCredentials(this, REQUEST_CODE_LOGIN, null,
GoogleLoginServiceConstants.REQUIRE_GOOGLE,
BLOGGER_SERVICE, true);
I have this permissions in my manifest:
But I got a SecurityException:
ERROR/AndroidRuntime(20985): java.lang.SecurityException: caller pid 20985 uid 10044 lacks com.google.android.googleapps.permission.GOOGLE_AUTH.BLOGGER
What could be wrong?
Hey Guys,
does anybody know how i can access a custom cell within the - (void)tableView:commitEditingStyle:forRowAtIndexPath:. I need access to my Custom Cell Class to retrieve some parameters.
Thanks.
I have a custom UIViewController in a UITabbarController and want to respond to rotation events. When a rotation occurs, the tabbarcontroller and the viewcontroller get rotated. However, the view in the viewcontroller doesn't get redrawn properly: the layout doesn't autoresize and it is black on parts of the screen.
The strange thing is that it works when I go to another tab and the back again to my original viewcontroller.
What could possibly be wrong? I checked that didRotateFromInterfaceOrientation:fromInterfaceOrientation is being called. However, the view.frame.size values are still the old ones from before the rotation. That's probably not correct.
Hey
is there any way to send whats in a text view (im trying to make a suggestion box) to my email address?
example
user types in the box " I think you should add twitter support"
then that is sent in the background to my email address [email protected]
then a message is popped up on the screen saying "suggestion sent"
just an example of what i mean
Any ideas, tutorial links would be greatly appreciated guys
Thanks
Hi all,
I want to use mobile substrate to "hook" some code into IPhone's "MobileCal" app so that the injected code will send a notification to my app MobileCal gets a call notification. But I'm out of luck and no clue which method need to be replaced by my "hooking" method in the "MobileCal" app.
For example, the "MobileLog" and "iRealSMS" has the same functionality and they used mobile substrate to hook their code into "MobileCal" app.
If any one has any clue, I would definitely appreciate them.
I am having MKAnnotationView and i have added UIButton to it, by addSubView method with IBAction assigned to it using addTarget method. But when i tabbed on that button IBAction doesn't called ....!
I am not getting, Why it is not working?
How can i add button to MKannotationView so that its IBAction called ???
Plz. help me.
Thanks
Hey there,
I am planning to develop an iPhone application heavily relying on sqlite DB ,
from different links I have gone through this seems to be a great tool and has some really good support.
As my app is still in the planning process
I would like to ask if there are any Issues with SQLlite database ? from memory management to Queries and data sizes and multiple access etc;
Please share your experience using SQLite DB in iPhone and what problems did you face?
I just want to make a note of these exceptions so that I may plan my App well and do not have any issues raised in the middle of the development process.
Thanx for your contribution.
I want to use AVAudioPlayer to play M4p files from iTunes generator. I could use uiWebView to play it and it worked, but I want to put an image of my choice on the background of the player instead of the "quick time" logo. Can you help me as how to do this?
Here is an example of the m4p file I want to play with AVAudioPlayer.
http://a801.phobos.apple.com/us/r1000/059/Music/b9/0d/be/mzi.zqnndbil.aac.p.m4p
Seriously, big thanks in advance!!
I'm working on a little game in OpenGL ES.
In the background, there is a world/map. The map is just a large texture.
Zoom/pinch/pan is used to move around. And I'm using glOrthof (left, right, bottom, top, zNear, zFar) to implement the zoom/pinch.
When I zoom in, the sprites on top of the map is also zoomed in. But I would like to have some sprites stay at a fixed size.
I could probably calculate a scale factor, depending on the parameters to glOrthof, but there must be a more natural and straightforward way of doing that, instead of scaling the sprites down when I zoom in.
If I add some text or some GUI elements on top of the map, they should definately have a fixed size.
Is there a solution to do this, or do I have to leave fixed values in glOrthof and implement zoom/pinch in another way?
EDIT: To be more clear: I want sprites that zoom in/out along with the map, but stay at the same size.
I have some elements that are like the pins on the iPhone's map application. When you zoom, the pins stay the same size, but move around on the screen to stay on the same spot on the map. That is mainly what I want a solution for.
Solutions for this already came below, thanks!
Hi guys,
I have an object NetworkMember that has no attributes but is defined by its relationships Person, Network, Level and Role. In my app, I've found all the four relationships, but I want to make sure not to double-register my NetworkMember, thus I'd like to search for this NSManagedObject before instantiating it.
How should I write a query that queries for an NSManagedObject just consisting of relationships?
Cheers
Nik
How would you write a universal app that uses classes introduced in iPhone OS 3.2, such as UIPopoverController and UISplitViewController? On Jeff LaMarche's blog about this, Ole provides a method for instantiating these objects; you would instantiate a UIPopoverController like so: [NSClassFromString(@"UIPopoverController") alloc].
This is fine for instantiating these classes in code but what about protocols and their methods? My iPad app uses a UISplitViewController and has a class that needs to conform to the UISplitViewControllerDelegate and UIPopoverControllerDelegate. How would you declare this? And how would you work with a method such as the following?
- (void)splitViewController:(UISplitViewController *)svc
willHideViewController:(UIViewController *)aViewController
withBarButtonItem:(UIBarButtonItem *)barButtonItem
forPopoverController:(UIPopoverController *)pc
where the method call requires UISplitViewController to be passed in?
Hello guys,
I've been trying to blend two UIImage for about 2 days now and I've been getting some BAD_ACCESS errors. First of all, I have two images that have the same orientation, basically I'm using the CoreGraphics to do the blending.
One curious detail, everytime I modify the code, the first time I compile and run it on device, I get to do everything I want without any sort of trouble. Once I restart the application, I get error and the program shuts down.
Can anyone give me a light? I tried accessing the baseImage sizes dynamically, but it gives me bad access too.
Here's a snippet of how I'm doing the blending.
UIGraphicsBeginImageContext(CGSizeMake(320, 480));
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextTranslateCTM(context, 0, 480);
CGContextScaleCTM(context, 1.0, -1.0);
CGContextDrawImage(context, rect, [baseImage CGImage]);
CGContextSetBlendMode(context, kCGBlendModeOverlay);
CGContextDrawImage(context, rect, [tmpImage CGImage]);
[transformationView setImage:UIGraphicsGetImageFromCurrentImageContext()];
UIGraphicsEndImageContext();
I tried using the load function of the SoundPool that takes a FileDescriptor, because I wanted to be able to set the offset and length. The File is not stored in the Ressources but a file on the storage card. Even though neither the load nor the play function of the SoundPool throw any Exception or print anything to the console, the sound is not played. Using the same code, but use the file path string in the SoundPool constructor works perfectly.
This is how I have tried the loading (start equals 0 and length is the length of the file in miliseconds):
FileInputStream fileIS = new FileInputStream(new File(mFile));
mStreamID = mSoundPool.load(fileIS.getFD(), start, length, 0);
mPlayingStreamID = mSoundPool.play(mStreamID, 1f, 1f, 1, 0, 1f);
If I would use this, it works:
mStreamID = mSoundPool.load(mFile, 0);
mPlayingStreamID = mSoundPool.play(mStreamID, 1f, 1f, 1, 0, 1f);
Any ideas anyone?
Thanks
In my project directory, top level, I have Icon.png. Double-checked in Photoshop, it's 57x57. When I submit my application via iTunes Connect or Application Loader, I get an error message saying my icon file is 0x0. Any idea why this happens?
Hi,
I have a linear layout in my main.xml which has a listview. Now I want to create a bottom bar below listview.
Bottombar has a background image and two buttons with their individual background images. I want to put these two buttons on common background image.
I have read that this can be achieved using FrameLayout. But since I am using LinearLayout as base layout in my main.xml, is there any way to this design using linearlayout ?
Although my relativelayout looks very similar on WVGA800 and WVGA854 on the emulator, theres different spacing on some of the objects because I'm going off of marginleft or marginright. Since the 854 is a greater width, its pushing some objects differently. Is there any way I could target either one to adjust for the different margins?
I am developing an iPhone application for jail broken phones and in this application I would like to fetch user's phone number.
I have gone through the entire stackoverflow.com and found some relevant answers but all of them are obsolete and doesn't work with iOS 4.0 anymore.
The most famous solution for this problem is
NSString *num = [[NSUserDefaults standardUserDefaults] stringForKey:@"SBFormattedPhoneNumber"];
but as I mentioned this solution no more works with iOS 4.0
As my application is intended towards the jail broken phones and not intended the Apple app store so I am not worried about my app rejection, hence any private API will also work for me.
Also please let me know if we can fetch IMSI number from SIM using any private APIs of iPhone
Hi,
I have written a filewriter for my android application. It is to function on a Galaxy Tab, so my minSdkVersion has to be at least 4, so it will fill the screen. I originally started out with SdkVersion = 2 and at that point my filewriter worked perfectly. Changing the SdkVersion to 4 introduced the problem. My filewriter doesn't work anymore! The application runs fine, but a file doesn't get created.
My .java file looks like this:
public class HelloAndroid extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView tv = new TextView(this);
tv.setText("Hello, Android");
setContentView(R.layout.main);
//definerer en knap kaldet button1 og sætter en listener på denne.
Button button1 = (Button)findViewById(R.id.btnClickMe);
button1.setOnClickListener(btnListener);
//definerer en knap kaldet button2 og sætter en listener på denne.
Button button2 = (Button)findViewById(R.id.btnClickMe2);
button2.setOnClickListener(btnListener2);
}
//en variabel af typen 'long' deklæres og kaldes tid1.
public long time1;
private OnClickListener btnListener = new OnClickListener()
{
public void onClick(View v)
{
//Når der klikkes på button1 gemmes et tal i variablen tid1.
time1 = System.currentTimeMillis();
}
};
//en variabel af typen 'long' deklæres og kaldes tid2.
public long time2;
// en variabel af typen 'string' deklæres og kaldes tid:
public String string1 = "time:";
private OnClickListener btnListener2 = new OnClickListener()
{
public void onClick(View v)
{
//Når der klikkes på button2 gemmes et tal i variablen tid2.
time2 = System.currentTimeMillis();
// Herefter oprettes en fil kaldet "file.txt".
try{
File file = new File(Environment.getExternalStorageDirectory(), "file.txt");
file.createNewFile();
BufferedWriter writer = new BufferedWriter(new FileWriter(file,true));
//string1 og tid2-tid1 skrives til filen. tid2-tid1 giver den tid der går fra der er trykket på den ene knap til den anden i millisekunder.
writer.write(string1 + "\t" + (time2-time1));
writer.newLine();
writer.flush();
writer.close();
} catch (IOException e) {
e.printStackTrace();
}
}
};
}
And my manifest.xml looks like this:
<?xml version="1.0" encoding="utf-8"?>
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".HelloAndroid"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Why does my filewriter not work with minSdkVersion 2? Do i have to make a new filewriter? or what to do?
Sorry for the messy code, i'm quite new to programming :)
I am trying to write a simple application that gets updated. For this I need a simple function that can download a file and show the current progress in a ProgressDialog. I know how to do the ProgressDialog, but I'm not sure how to display the current progress and how to download the file in the first place.
Hi,
I'm just wondering if anyone has any idea on how you can create a view that looks like the user profile view in apps like Tweetie, where there are seemingly multiple tables with a couple of normal (straight up and down tables) and then two rows of six cells, which in Tweeties case have the number of followers, following etc.
I'm trying to make a similar view for my app, but can't seem to find out the best way to create it. Any tutorials, advice etc. would be appreciated.
Thanks.
P.S. Here's a picture of the view which I'm trying to recreate.