Difference between AppCompatActivity and Activity - android-activity

I am trying to add a menu in my application. It works if it extends AppCompatActivity, but not if it extends Activity. Is the menu not available in Activity? People say Activity is basic where AppCompatActivity is something developed later. Is there any good reason I should use Activity instead of AppCompatActivity? AppCompatActivity is the default but in my learning it was recommended to choose Activity, but I encountered the problem in creating the menu (action bar). Please help!

AppCompatActivity is a class from v7 Appcompat library. This is a compatibility library that back ports some features of recent versions of Android to older devices.
It enables the use of the ActionBar and Material Design specific implementations like the Toolbar for older devices using versions of Android as old as Android 2.1 (API level 7). So if your app's minSdkVersion is a version that does not support the new features in newer APIs you can use the support library to enable those features. If you use support library ,you have to have all your activities extend AppCompatActivity instead of the Activity base class.

As this answer What's the enhancement of AppCompatActivity over ActionBarActivity? explains, unless you're targeting API levels older than 11, you should probably use AppCompatActivity. If you are however, only targeting API levels above that, you should be fine just using Activity, since the newer versions have everything you need to create the menu on the ActionBar.
Hope it helps

Related

How to make Modularization in Flutter to separate each application feature

On Android native to separate each application feature, structured the project, implementing architecture component and to make it easier to work in a team you can use modularization, so each person can focus on their respective work by focusing only on the module. If I want to make a flutter application with examples of 3 application features (login, register, profile) and want to implement modularization for each feature to make it easier to work as a team. How do you implement the modular? Are there references to its best practices for modularizing Flutter? Because if on Android Native there are already many related articles while I check for Flutter it hasn't found it yet.
Create each feature as a package(library) and add it whenever you want to the main app. For example in my app I use main.dart as a navigator manager and each screen is in different packages.
And this is an example of implementing it: https://github.com/rrifafauzikomara/flutter_modularization

Does Flutter Support iOS Features?

I am starting to work on one big project which includes Sirikit, Game Center, Fingerprint, health kit and home kit etc.
So my doubt is can I implement those features & other features which are provided by ios using the flutter..?
Flutter can't generate bitcode. So, it can't integrate features like Siri, interactive notifications, watchOS, tvOS, Today and other modern extensions.
It compiles like it was before 2015. Before iOS extensions. With same limitations.
Yes and no - you could definitely use some and probably all of those, but you'll have to write Platform Channels. I use fingerprint for example in my app.
There may exist plugins for some of the functionality - see the flutter packages page.

ANE for one platform on Flex mobile project for iOS and Android

I'm very new at Flex Mobile Projects and native extension.
I have a big doubt... If I have an ANE that only works on iOS or Android, can I use it into a project for Android AND iOS?
I mean, if I want to do something and I've only found and ANE that works for iOS and another ANE that works for Android, can I create only one project and depending on the device use one or another? or should I create two different projects?
Thanks in advance
You should be able to correctly code using two different ANE's, one for each platform, but it does really depend on the ANE.
Most provide a isSupported flag to allow you to determine programmatically whether the extension is supported on the current platform.
if (ExtensionA.isSupported)
{
// Use extension A
}
else if (ExtensionB.isSupported)
{
// Use extension B
}
It's also worth noting that if the extension isn't correctly implementing a "default" version (i.e. one that gets used on unsupported platforms) this may fail. Really comes down to the ANE implementation.

How can I add NSSpeechSynthesizer Class Reference?

How can i add NSSpeechSynthesizer Class Reference.
I think it is in
/System/Library/Frameworks/AppKit.framework.
However there is no such framework name in framework window when I am clicking add existing frame work.
Can any one help me to do it.
VSSpeechSynthesizer is available for the iOS - but it is a private API and as such will likely be rejected from the app store. However you can still make apps for private consumption. I consider this a bug as it makes creating accessible apps for the partially sighted for instance, harder. I have filed Bug ID #: 9451650 Bug Title: VSSpeechSynthesizer is Private
I currently use Flite TTS in my App. All hopes fix on the Nuance integration in iOS5 being available as a public API.
AppKit framework is MacOS framework, not iOS, and so NSSpeechSynthesizer class is also available on Mac only.
Check this question on SO for the list of some 3rd-party text-to-speach engines available on iPhone
You can find it inside iPhone SDK
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.0.sdk
/System/Library/PrivateFrameworks/VoiceServices.framework/VoiceServices

How to develop distributable UI controls for iPhone?

I would like to develop a reusable UI control for iPhone. How should I go about doing this? When I say reusable I mean it's packaged in a dll (or whatever is used on iPhone platform) so it can be reused on multiple projects.
While dynamic libraries are not allowed to be used in iPhone applications that are to be sold on the iPhone App Store, here's a tutorial on building static libraries with the iPhone SDK. (assuming you don't want to release source code)
You have two options:
Supply the full source code. Other developers can then add it directly to their app.
Distribute the compiled version of your code as a static library.
As you're planning to develop a UI control, I suggest you also develop an IB plugin and ship that with it too.
You probably want to provide custom Interface Builder objects, or maybe source code libraries.
Well, the Xcode way would be to bundle your code into a Framework and link to that. However, under the iPhone you can't link to non Apple approved frameworks (even if they are your own)
So you would probably have to link in the source to the reusable code. A good article here