I would like to write a counter that shows how many seconds an app has be running for. (textView) and the counter should be cumulative and starts from where it left off. Im new to iphone sdk.
Hi, I have a problem with initializing my app properly after the autostart.
I've managed to get an autostart to work, after a reboot the app is shown as started but the timer's are not.
My guess is that the "onCreate" function of MyApp is not called when I call the context.startService(). The timers are set in the doActivity() function of MyApp.
I would greatly appreciate any tips on what I could be doing wrong or links to good tutorials. :)
The manifest:
<activity android:name=".MyApp"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver android:name="MyApp_Receiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>[/syntax]
MyApp_Receiver is a BoradcastReciever with the following two functions
public void onReceive(Context context, Intent intent) {
// Do Autostart if intent is "BOOT_COMPLETED"
if ((intent.getAction() != null) && (intent.getAction().equals("android.intent.action.BOOT_COMPLETED")))
{
// Start the service
context.startService(new Intent(context, MyApp.class));
}
// Else do activity
else
MAIN_ACTIVITY.doActivity();
}
public static void setMainActivity(MyApp activity)
{
MAIN_ACTIVITY = activity;
}
MyApp extends PreferenceActivity and has an onCreate() and a doActivity(), the doActivity() reads out the preferences and sets a timer depending on them.
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Show preferences
addPreferencesFromResource(R.xml.preferences);;
// Register Preference Click Listeners
getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
// Prepare for one-shot alarms
if (mIntent == null)
{
mIntent = new Intent(MyApp.this, MyApp_Receiver.class);
mSender = PendingIntent.getBroadcast(MyApp.this,
0, mIntent, 0);
MyApp_Receiver.setMainActivity(this);
}
// Refresh and set all timers on start
doActivity();
}
I'm undertaking a rather large conversion from a legacy database-driven Windows app to a Rails app. Because of the large number of forms and database tables involved, I want to make sure I've got the right methodology before getting too far.
My chief concern is minimizing the amount of code I have to write. There are many models that interact together, and I want to make sure I'm using them correctly. Here's a simplified set of models:
class Patient < ActiveRecord::Base
has_many :PatientAddresses
has_many :PatientFileStatuses
end
class PatientAddress < ActiveRecord::Base
belongs_to :Patient
end
class PatientFileStatus < ActiveRecord::Base
belongs_to :Patient
end
The controller determines if there's a Patient selected; everything else is based on that.
In the view, I will be needing data from each of these models. But it seems like I have to write an instance variable in my controller for every attribute that I want to use. So I start writing code like this:
@patient = Patient.find(session[:patient])
@patient_addresses = @patient.PatientAddresses
@patient_file_statuses = @patient.PatientFileStatuses
@enrollment_received_when = @patient_file_statuses[0].EnrollmentReceivedWhen
@consent_received = @patient_file_statuses[0].ConsentReceived
@consent_received_when = @patient_file_statuses[0].ConsentReceivedWhen
The first three lines grab the Patient model and its relations. The next three lines are examples of my providing values to the view from one of those relations.
The view has a combination of text fields and select fields to show the data above. For example:
<%= select("patientfilestatus", "ConsentReceived", {"val1"="val1", "val2"="val2", "Written"="Written"}, :include_blank=true )%
<%= calendar_date_select_tag "patient_file_statuses[EnrollmentReceivedWhen]", @enrollment_complete_when, :popup=:force %
(BTW, the select tag isn't really working; I think I have to use collection_select?)
My questions are:
Do I have to manually declare the value of every instance variable in the controller, or can/should I do it within the view?
What is the proper technique for displaying a select tag for data that's not the primary model?
When I go to save changes to this form, will I have to manually pick out the attributes for each model and save them individually? Or is there a way to name the fields such that ActiveRecord does the right thing?
Thanks in advance,
Aaron.
I have a tab bar app that I would only like to allow rotating to landscape in one of the tabs. Currently, it does not rotate. Is there a configuration option that allows it to change to landscape when I rotate the display?
I am making an example app of a game. I have a folder i set as the current directory from within visual studios which includes pngs,ogg,config.json,etc.
When i 'publish' these files are not included. How do i properly add a media files/folders into the project?
Hi,
I would like to open a webpage and run a javascript function from within a java app.
For example I would like to open the page www.mytestpage.com and run the following javascript code:document.getElementById("txtEmail").value="[email protected]";submit();void(0);
This works in a browser...how can I do it programatically?
Thanks!
I would like to Integrate Google Analytics Tracking into my IOS APP.
I have integrated Google Analytics Library and Add It To my Application.
cf. https://developers.google.com/analytics/devguides/collection/ios/v2/
into my code to tracking my view contact
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
self.trackPageView = @"Contact Screen";
//
}
A have this error "Property 'TrackPageView' not found on object of the type 'ContactViewController'" Please help me
Hi
How can I emded a pdf inside my app? Should i just pass the pdfs file url to a web view and let that take care of it or is there a better way/
Cheers
w://
Hi
Is there a permission to allow one app to read the (private) data/data//files/... files of another application? If not, how do backup programs like MyBackup work?
C
I need to develop a symbian application in which the app is triggered while taking a photo and upload to a web location with the GPS location of the phone. I would like to know which all devices can support this and is there any API restrictions or licence required to do this.
I have a python web application that needs to launch a long running process. The catch is I don't want it to wait around for the process to finish. Just launch and finish.
I'm running on windows XP, and the web app is running under IIS (if that matters).
So far I tried popen but that didn't seem to work.
Hi all,
I want to implement a functionality similar to found in Pages app..i.e. text floating around images, image zooming etc.. I have been struggling with this part of my application but no success yet. Would be grateful if someone provides me with some pointers in this regard , like 'Which UIControl should I use?','Help in thinking logic' etc..
Thanx in advance.
Is is possible to display html document in J2ME mobile app? Is it possible using for example WebKit? I was looking for some webkit's j2me implementation or some tutorial or advice in google but found nothing.
Hi - Im trying to find a way to programme/buy an app to use the iphone to detect someones skin tone against an objective scale using RGB froma phot they take of themselves. Anyone got any pointers?
I created a virtual directory for my php app.
Now I get the "Directory Listing Denied
This Virtual Directory does not allow contents to be listed."
Do I need to make some kind of dummy index.asp file that redirects (OR PREFERRED: just displays index.php) or how to solve this?
I have restricted access to webserver, but index.php is set to be default
I want to how know how to set about writing a monitoring app such as Windows task manager using Java Swing. The main feature I am concerned with is the grid with a graph which get drawn with time. What are the features that I need to accomplish this? (e.g.: Java2D etc).
Aside from the standard stock apps shipped with your phone, what's the best Android 2.1 app in the Market Place today? You know what can't live without it? What makes your life better/easier? What just plan works day-in and day-out?
Hi,
I'm using
org.springframework.web.servlet.DispatcherServlet
and
org.springframework.ws.transport.http.MessageDispatcherServlet
In the same app but each is loading own application contexts, I need to load all beans in a single application context.
The application consists of typical layers webappdao etc
What I have tried is to use one single spring-root-context.xml by setting it in the contextConfigLocation.
But didn't help, this has been an issue for me for a long time an I would appreciate any help with this.
Any online references would be a great help.
Regards
Ramo
I have created in-app purchase for non-consumable object application in iPhone using with store kit its properly working, but i am not getting that from which function information about product is checked that product is purchased or not.
please help me out
thnx
Kunal
Hi,
I have a java web application .
Currently the application is installed in a cli mode [on windows/linux /solaris] by running sh or cmd scripts.
I would like to create a GUI for the App installation so that user can edit info in gui for the installation.
Any pointers/Best practices for developing gui would be helpful.
thank you
In my application,I want to remind the user to write a reivew,
however,when I copy the link write a review as shown below:
http://itunes.apple.com/tw/app/id MyID?mt=8
It is the same as the product link.
I follow this guide:
http://blogs.oreilly.com/iphone/2008/08/scraping-appstore-reviews.html
The US account can successfully link to the page,but the China-Twain Can not ,it pop an alertView saying:Cannot connect to iTunes Store The iTunes Store is not supported in this country.
anyone has good suggestions?
I'm trying to show one public twitter profile in one WebView of my app, is not necessary to login twitter, in the MotoDev Simulator this works fine, but in the physical device don't work, this: "403 fobiden limite exceed rate" error appears, this is the simple code line that I'm using:
webView.loadUrl("https://mobile.twitter.com/#!/asambleaecuador");
and works fine into de MotoDev simulator AVD
....can somebody helpme please!!!
Thanks